/** * Adds a sequence of gridded buttons that grow * where each is separated by a default gap. * Honors this builder's button order. If you * want to use a fixed left to right order, * add individual buttons. * * @param buttons an array of buttons to add * * @see LayoutStyle */ public void addGriddedGrowingButtons(JButton[] buttons) { int length = buttons.length; for (int i = 0; i < length; i++) { int index = leftToRight ? i : length -1 - i; addGriddedGrowing(buttons[index]); if (i < buttons.length - 1) addRelatedGap(); } }
/** * Adds a sequence of related gridded buttons each separated by * a default gap. Honors this builder's button order. If you * want to use a fixed left to right order, add individual buttons. * * @param buttons an array of buttons to add * * @see LayoutStyle */ public void addGriddedButtons(JButton[] buttons) { int length = buttons.length; for (int i = 0; i < length; i++) { int index = leftToRight ? i : length -1 - i; addGridded(buttons[index]); if (i < buttons.length - 1) addRelatedGap(); } }
/** * Adds a sequence of related gridded buttons each separated by a default * gap. Honors this builder's button order. If you want to use a fixed left * to right order, add individual buttons. * * @param buttons * an array of buttons to add * * @see LayoutStyle */ public void addGriddedButtons(JButton[] buttons) { int length = buttons.length; for (int i = 0; i < length; i++) { int index = leftToRight ? i : length - 1 - i; addGridded(buttons[index]); if (i < buttons.length - 1) addRelatedGap(); } }
/** * Adds a sequence of gridded buttons that grow where each is separated by a * default gap. Honors this builder's button order. If you want to use a * fixed left to right order, add individual buttons. * * @param buttons * an array of buttons to add * * @see LayoutStyle */ public void addGriddedGrowingButtons(JButton[] buttons) { int length = buttons.length; for (int i = 0; i < length; i++) { int index = leftToRight ? i : length - 1 - i; addGriddedGrowing(buttons[index]); if (i < buttons.length - 1) addRelatedGap(); } }
/** * Builds and returns a filled button bar with Add, Remove, and * Properties. * * @param add the Add button * @param remove the Remove button * @param properties the Properties button * @return a panel that contains the button(s) */ public static JPanel buildAddRemovePropertiesBar( JButton add, JButton remove, JButton properties) { ButtonBarBuilder builder = new ButtonBarBuilder(); builder.addGriddedGrowing(add); builder.addRelatedGap(); builder.addGriddedGrowing(remove); builder.addRelatedGap(); builder.addGriddedGrowing(properties); return builder.getPanel(); }
/** * Builds and returns a filled button bar with Add, Remove, and Properties. * * @param add * the Add button * @param remove * the Remove button * @param properties * the Properties button * @return a panel that contains the button(s) */ public static JPanel buildAddRemovePropertiesBar(JButton add, JButton remove, JButton properties) { ButtonBarBuilder builder = new ButtonBarBuilder(); builder.addGriddedGrowing(add); builder.addRelatedGap(); builder.addGriddedGrowing(remove); builder.addRelatedGap(); builder.addGriddedGrowing(properties); return builder.getPanel(); }
private JPanel buildToolBar() { final ButtonBarBuilder builder = new ButtonBarBuilder(); builder.addGlue(); // i18n[mysql.alterDlgAlter=Alter] builder.addGridded(new JButton(s_stringMgr.getString("mysql.alterDlgAlter"))); builder.addRelatedGap(); // i18n[mysql.alterDlgClose=Close] builder.addGridded(new JButton(s_stringMgr.getString("mysql.alterDlgClose"))); return builder.getPanel(); }
private JPanel buildToolBar() { final ButtonBarBuilder builder = new ButtonBarBuilder(); builder.addGlue(); final GenerateSqlDialog dlg = this; // i18n[mssql.ok=OK] JButton okButton = new JButton(s_stringMgr.getString("mssql.ok")); okButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { _wasCompleted = true; dlg.setVisible(false); } }); builder.addGridded(okButton); builder.addRelatedGap(); // i18n[mssql.cancel=Cancel] JButton cancelButton = new JButton(s_stringMgr.getString("mssql.cancel")); cancelButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { _wasCompleted = false; dlg.setVisible(false); } }); builder.addGridded(cancelButton); return builder.getPanel(); }
/** * 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 */ public static JPanel buildHelpBar(JButton help, JButton[] buttons) { ButtonBarBuilder builder = new ButtonBarBuilder(); builder.addGridded(help); builder.addRelatedGap(); builder.addGlue(); builder.addGriddedButtons(buttons); return builder.getPanel(); }
/** * 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 */ public static JPanel buildHelpBar(JButton help, JButton[] buttons) { ButtonBarBuilder builder = new ButtonBarBuilder(); builder.addGridded(help); builder.addRelatedGap(); builder.addGlue(); builder.addGriddedButtons(buttons); return builder.getPanel(); }
if (leftAlignedButtons != null) { builder.addGriddedButtons(leftAlignedButtons); builder.addRelatedGap(); builder.addRelatedGap(); builder.addGriddedButtons(rightAlignedButtons);
if (leftAlignedButtons != null) { builder.addGriddedButtons(leftAlignedButtons); builder.addRelatedGap(); builder.addRelatedGap(); builder.addGriddedButtons(rightAlignedButtons);