Search in sources :

Example 1 with ButtonBarBuilder

use of com.jgoodies.forms.builder.ButtonBarBuilder in project jgnash by ccavanaugh.

the class StaticUIMethods method buildHelpBar.

/**
     * Builds and returns a right aligned bar with help and other buttons.
     *
     * @param help    the help button to add on the left side
     * @param buttons an array of buttons to add
     * @return a right aligned button bar with the given buttons
     */
@SuppressWarnings("ConfusingArgumentToVarargsMethod")
public static JPanel buildHelpBar(final JButton help, final AbstractButton... buttons) {
    ButtonBarBuilder builder = new ButtonBarBuilder();
    builder.addButton(help);
    builder.addUnrelatedGap();
    builder.addGlue();
    builder.addButton(buttons);
    return builder.getPanel();
}
Also used : ButtonBarBuilder(com.jgoodies.forms.builder.ButtonBarBuilder)

Example 2 with ButtonBarBuilder

use of com.jgoodies.forms.builder.ButtonBarBuilder in project jgnash by ccavanaugh.

the class IncomeDialog method layoutMainPanel.

private void layoutMainPanel() {
    initComponents();
    FormLayout layout = new FormLayout("d:g", "80dlu:g");
    DefaultFormBuilder builder = new DefaultFormBuilder(layout);
    builder.border(Borders.DIALOG);
    builder.append(new JScrollPane(table));
    // build the button bar
    ButtonBarBuilder bbb = new ButtonBarBuilder();
    bbb.addButton(newButton, deleteButton);
    bbb.addUnrelatedGap();
    bbb.addGlue();
    bbb.addButton(deleteAllButton);
    builder.append(bbb.getPanel());
    builder.append(tabbedPane);
    builder.nextLine();
    builder.appendUnrelatedComponentsGapRow();
    builder.nextLine();
    builder.append(StaticUIMethods.buildOKCancelBar(okButton, cancelButton));
    getContentPane().add(builder.getPanel(), BorderLayout.CENTER);
}
Also used : FormLayout(com.jgoodies.forms.layout.FormLayout) JScrollPane(javax.swing.JScrollPane) DefaultFormBuilder(com.jgoodies.forms.builder.DefaultFormBuilder) ButtonBarBuilder(com.jgoodies.forms.builder.ButtonBarBuilder)

Example 3 with ButtonBarBuilder

use of com.jgoodies.forms.builder.ButtonBarBuilder in project jgnash by ccavanaugh.

the class CurrencyExchangeDialog method layoutMainPanel.

private void layoutMainPanel() {
    initComponents();
    FormLayout layout = new FormLayout("f:p:g", "");
    DefaultFormBuilder builder = new DefaultFormBuilder(layout);
    builder.border(Borders.DIALOG);
    builder.appendSeparator(rb.getString("Title.Currencies"));
    builder.nextLine();
    builder.appendRelatedComponentsGapRow();
    builder.nextLine();
    builder.append(layoutTopPanel());
    builder.appendSeparator(rb.getString("Title.ExchangeRate"));
    builder.nextLine();
    builder.appendRelatedComponentsGapRow();
    builder.nextLine();
    builder.appendRow(RowSpec.decode("f:max(50dlu;p):g"));
    builder.append(layoutMiddlePanel());
    builder.appendSeparator();
    builder.append(layoutBottomPanel());
    builder.nextLine();
    builder.appendUnrelatedComponentsGapRow();
    builder.nextLine();
    builder.append(new ButtonBarBuilder().addGlue().addButton(closeButton).build());
    getContentPane().add(builder.getPanel(), BorderLayout.CENTER);
    pack();
    setMinimumSize(getSize());
}
Also used : FormLayout(com.jgoodies.forms.layout.FormLayout) DefaultFormBuilder(com.jgoodies.forms.builder.DefaultFormBuilder) ButtonBarBuilder(com.jgoodies.forms.builder.ButtonBarBuilder)

Example 4 with ButtonBarBuilder

use of com.jgoodies.forms.builder.ButtonBarBuilder in project jgnash by ccavanaugh.

the class SecuritiesHistoryDialog method buildButtonBar.

private JPanel buildButtonBar() {
    ButtonBarBuilder builder = new ButtonBarBuilder();
    builder.addButton(deleteButton, clearButton, applyButton);
    builder.addGlue();
    builder.addButton(closeButton);
    return builder.getPanel();
}
Also used : ButtonBarBuilder(com.jgoodies.forms.builder.ButtonBarBuilder)

Example 5 with ButtonBarBuilder

use of com.jgoodies.forms.builder.ButtonBarBuilder in project jgnash by ccavanaugh.

the class RecurringEntryDialog method createTransactionPanel.

private JPanel createTransactionPanel() {
    FormLayout layout = new FormLayout("left:p, 4dlu, p:g, 4dlu, p", "f:p, 3dlu, f:p, 3dlu, f:p, 3dlu, f:40dlu:g");
    layout.setRowGroups(new int[][] { { 1, 3, 5 } });
    CellConstraints cc = new CellConstraints();
    JPanel p = new JPanel(layout);
    descriptionField = new JTextFieldEx();
    accountCombo = new AccountListComboBox();
    notesArea = new JTextArea(5, 20);
    notesArea.setLineWrap(true);
    notesArea.setAutoscrolls(true);
    JScrollPane pane = new JScrollPane(notesArea);
    pane.setAutoscrolls(true);
    transactionField = new JTextFieldEx();
    transactionField.setEditable(false);
    editButton = new JButton(rb.getString("Button.Edit"));
    deleteButton = new JButton(rb.getString("Button.Delete"));
    p.add(new JLabel(rb.getString("Label.Account")), cc.xy(1, 1));
    p.add(accountCombo, cc.xywh(3, 1, 3, 1));
    p.add(new JLabel(rb.getString("Label.Description")), cc.xy(1, 3));
    p.add(descriptionField, cc.xywh(3, 3, 3, 1));
    p.add(new JLabel(rb.getString("Label.Transaction")), cc.xy(1, 5));
    p.add(transactionField, cc.xy(3, 5));
    p.add(new ButtonBarBuilder().addButton(editButton, deleteButton).build(), cc.xy(5, 5));
    p.add(new JLabel(rb.getString("Label.Notes")), cc.xy(1, 7));
    p.add(pane, cc.xywh(3, 7, 3, 1));
    return p;
}
Also used : FormLayout(com.jgoodies.forms.layout.FormLayout) JScrollPane(javax.swing.JScrollPane) JPanel(javax.swing.JPanel) JTextArea(javax.swing.JTextArea) ButtonBarBuilder(com.jgoodies.forms.builder.ButtonBarBuilder) JButton(javax.swing.JButton) JLabel(javax.swing.JLabel) JTextFieldEx(jgnash.ui.components.JTextFieldEx) AccountListComboBox(jgnash.ui.components.AccountListComboBox) CellConstraints(com.jgoodies.forms.layout.CellConstraints)

Aggregations

ButtonBarBuilder (com.jgoodies.forms.builder.ButtonBarBuilder)35 FormLayout (com.jgoodies.forms.layout.FormLayout)17 JButton (javax.swing.JButton)17 ActionEvent (java.awt.event.ActionEvent)14 AbstractAction (javax.swing.AbstractAction)14 JScrollPane (javax.swing.JScrollPane)13 ActionMap (javax.swing.ActionMap)11 InputMap (javax.swing.InputMap)11 JDialog (javax.swing.JDialog)11 JPanel (javax.swing.JPanel)10 FormBuilder (com.jgoodies.forms.builder.FormBuilder)8 BorderLayout (java.awt.BorderLayout)8 Action (javax.swing.Action)8 DefaultFormBuilder (com.jgoodies.forms.builder.DefaultFormBuilder)6 Dimension (java.awt.Dimension)6 ButtonGroup (javax.swing.ButtonGroup)5 JTextField (javax.swing.JTextField)4 NamedCompound (org.jabref.gui.undo.NamedCompound)4 WindowLocation (org.jabref.gui.util.WindowLocation)4 Insets (java.awt.Insets)3