public void layout(final DefaultFormBuilder builder) { builder.nextLine(); }
public void addToParent(Container pParent) { JPanel panel = (JPanel)pParent; DefaultFormBuilder builder= (DefaultFormBuilder)panel.getClientProperty(SwingXMLBuilder.FORMBUILDER_PROPERTY); builder.nextLine(); } }
/** * Adds an internationalized (i15d) text label and component to the panel. * Then proceeds to the next data column. Goes to the next line if the * boolean flag is set. * * @param resourceKey * the resource key for the text to add * @param component * the component to add * @param nextLine * true forces a next line * @return the added label */ public JLabel appendI15d(String resourceKey, Component component, boolean nextLine) { JLabel label = appendI15d(resourceKey, component, 1); if (nextLine) { nextLine(); } return label; }
/** * Adds a text label and component to the panel; the component will span * the specified number columns. Proceeds to the next data column, * and goes to the next line if the boolean flag is set.<p> * * The created label is labeling the given component; so the component * gets the focus if the (optional) label mnemonic is pressed. * * @param textWithMnemonic the label's text - may mark a mnemonic * @param c the component to add * @param nextLine true forces a next line * @return the added label * @see JLabel#setLabelFor(java.awt.Component) */ public JLabel append(String textWithMnemonic, Component c, boolean nextLine) { JLabel label = append(textWithMnemonic, c); if (nextLine) { nextLine(); } return label; }
/** * Adds a text label and component to the panel; the component will span * the specified number columns. Proceeds to the next data column, * and goes to the next line if the boolean flag is set.<p> * * The created label is labeling the given component; so the component * gets the focus if the (optional) label mnemonic is pressed. * * @param textWithMnemonic the label's text - may mark a mnemonic * @param c the component to add * @param nextLine true forces a next line * @return the added label * @see JLabel#setLabelFor(java.awt.Component) */ public JLabel append(String textWithMnemonic, Component c, boolean nextLine) { JLabel label = append(textWithMnemonic, c); if (nextLine) { nextLine(); } return label; }
public StandardPanelComponent() { super(); dataMapName = new JLabel(); dataMapName.setFont(dataMapName.getFont().deriveFont(1)); superclassPackage = new JTextField(); FormLayout layout = new FormLayout( "right:77dlu, 3dlu, fill:200:grow, 3dlu", ""); builder = new DefaultFormBuilder(layout); builder.append(dataMapName); builder.nextLine(); builder.append("Superclass Package:", superclassPackage); setLayout(new BorderLayout()); add(builder.getPanel(), BorderLayout.CENTER); }
private void appendLabeledComponent(final DefaultFormBuilder formBuilder, String labelKey, Component component) { final String text = TextUtils.getText(labelKey); final JLabel label = new JLabel(text); TranslatedElement.TEXT.setKey(label, labelKey); formBuilder.append(label, 5); formBuilder.append(component); formBuilder.nextLine(); }
public StandardModePanel() { FormLayout layout = new FormLayout( "right:77dlu, 1dlu, fill:100:grow, 1dlu, left:80dlu, 1dlu", ""); builder = new DefaultFormBuilder(layout); builder.append("Output Directory:", outputFolder, selectOutputFolder); builder.nextLine(); setLayout(new BorderLayout()); add(builder.getPanel(), BorderLayout.CENTER); } }
private void initView() { JLabel note = new JLabel( "* Custom sequences are supported on Oracle and Postgres"); note.setFont(note.getFont().deriveFont(Font.ITALIC).deriveFont(11f)); customPKName = new TextAdapter(new JTextField()) { protected void updateModel(String text) throws ValidationException { setPKName(text); } }; customPKSize = new TextAdapter(new JTextField()) { protected void updateModel(String text) throws ValidationException { setPKSize(text); } }; // assemble DefaultFormBuilder builder = new DefaultFormBuilder(new FormLayout( "right:70dlu, 3dlu, 20dlu, 3dlu, fill:177dlu", "")); builder.setDefaultDialogBorder(); builder.append("Sequence Name:", customPKName.getComponent(), 3); builder.append("Cached PK Size:", customPKSize.getComponent()); builder.nextLine(); builder.append("", note, 3); setLayout(new BorderLayout()); add(builder.getPanel(), BorderLayout.CENTER); }
private void addStyleBox(final DefaultFormBuilder formBuilder) { mStyleBox = uiFactory.createStyleBox(); mSetStyle = new BooleanProperty(ControlGroup.SET_RESOURCE); final StyleChangeListener listener = new StyleChangeListener(); mSetStyle.addPropertyChangeListener(listener); mSetStyle.layout(formBuilder); formBuilder.append(new JLabel(TextUtils.getText("style"))); formBuilder.append(mStyleBox); formBuilder.nextLine(); } private void addAutomaticLayout(final DefaultFormBuilder formBuilder) {
/** * Ensures that the cursor is in the grid. In case it's beyond the * form's right hand side, the cursor is moved to the leading column * of the next line. */ private void ensureCursorColumnInGrid() { if ( ( isLeftToRight() && (getColumn() > getColumnCount())) || (!isLeftToRight() && (getColumn() < 1))) { nextLine(); } }
/** * Ensures that the cursor is in the grid. In case it's beyond the form's * right hand side, the cursor is moved to the leading column of the next * line. */ private void ensureCursorColumnInGrid() { if ((isLeftToRight() && (getColumn() > getColumnCount())) || (!isLeftToRight() && (getColumn() < 1))) { nextLine(); } }
/** * Ensures that the cursor is in the grid. In case it's beyond the * form's right hand side, the cursor is moved to the leading column * of the next line. */ private void ensureCursorColumnInGrid() { if ( isLeftToRight() && getColumn() > getColumnCount() || !isLeftToRight() && getColumn() < 1) { nextLine(); } }
private JButton addStyleButton(DefaultFormBuilder formBuilder, String label, AFreeplaneAction action) { final JButton button = new JButton(){ private static final long serialVersionUID = 1L; { setUI(BasicButtonUI.createUI(this)); } }; button.addActionListener(action); button.setHorizontalAlignment(SwingConstants.LEFT); final String labelText = TextUtils.getText(label); UITools.addTitledBorder(button, labelText, StyleEditorPanel.FONT_SIZE); TranslatedElement.BORDER.setKey(button, label); formBuilder.append(button, formBuilder.getColumnCount()); formBuilder.nextLine(); return button; }
@Override public void layout(final DefaultFormBuilder builder) { final String labelKey = getLabel(); final String text = TextUtils.getOptionalText(labelKey); if (builder.getColumn() > 1) builder.nextLine(); final JComponent separator = builder.appendSeparator(text); if(text != null) { for (Component child : separator.getComponents()) { if(child instanceof JLabel) TranslatedElement.TEXT.setKey((JComponent) child, labelKey); break; } } }
/** * Ensures that we have a gap row before the next component row. Checks if * the current row is the given <code>RowSpec</code> and appends this row * spec if necessary. * * @param gapRowSpec * the row specification to check for */ private void ensureHasGapRow(RowSpec gapRowSpec) { if ((getRow() == 1) || (getRow() <= getRowCount())) return; if (getRow() <= getRowCount()) { RowSpec rowSpec = getCursorRowSpec(); if ((rowSpec == gapRowSpec)) return; } appendRow(gapRowSpec); nextLine(); }
/** * Ensures that we have a gap row before the next component row. * Checks if the current row is the given <code>RowSpec</code> * and appends this row spec if necessary. * * @param gapRowSpec the row specification to check for */ private void ensureHasGapRow(RowSpec gapRowSpec) { if ((getRow() == 1) || (getRow() <= getRowCount())) return; if (getRow() <= getRowCount()) { RowSpec rowSpec = getCursorRowSpec(); if ((rowSpec == gapRowSpec)) return; } appendRow(gapRowSpec); nextLine(); }
/** * Ensures that we have a gap row before the next component row. * Checks if the current row is the given {@code RowSpec} * and appends this row spec if necessary. * * @param gapRowSpec the row specification to check for */ private void ensureHasGapRow(RowSpec gapRowSpec) { if (getRow() == 1 || getRow() <= getRowCount()) { return; } if (getRow() <= getRowCount()) { RowSpec rowSpec = getCursorRowSpec(); if (rowSpec == gapRowSpec) { return; } } appendRow(gapRowSpec); nextLine(); }
@Override protected final JComponent buildEditorPanel() { FormLayout layout = new FormLayout("FILL:250DLU:GROW(1.0)", //$NON-NLS-1$ ""); //$NON-NLS-1$ DefaultFormBuilder builder = new DefaultFormBuilder(layout); builder.append(ToolBarFactory.buildToolBar(addAction, cloneAction, null, editAction, deleteAction), builder.getColumnCount()); builder.appendRow(builder.getLineGapSpec()); builder.nextLine(2); builder.appendRow("FILL:80DLU:GROW(1.0)"); builder.append(new JSyScrollPane(table), builder.getColumnCount()); return builder.getPanel(); }