Package com.jgoodies.forms.builder

Examples of com.jgoodies.forms.builder.ButtonBarBuilder2


     *
     * @param buttons  an array of buttons to add
     * @return a right aligned button bar with the given buttons
     */
    public static JPanel buildRightAlignedBar(JButton[] buttons) {
        ButtonBarBuilder2 builder = new ButtonBarBuilder2();
        builder.addGlue();
        builder.addButton(buttons);
        return builder.getPanel();
    }
View Full Code Here


     * @return a right aligned button bar with the given buttons
     */
    public static JPanel buildRightAlignedBar(
             JButton[] buttons,
             boolean leftToRightButtonOrder) {
        ButtonBarBuilder2 builder = new ButtonBarBuilder2();
        builder.setLeftToRightButtonOrder(leftToRightButtonOrder);
        builder.addGlue();
        builder.addButton(buttons);
        return builder.getPanel();
    }
View Full Code Here

     * @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) {
        ButtonBarBuilder2 builder = new ButtonBarBuilder2();
        builder.addButton(help);
        builder.addUnrelatedGap();
        builder.addGlue();
        builder.addButton(buttons);
        return builder.getPanel();
    }
View Full Code Here

     * @param properties    the Properties button
     * @return a panel that contains the button(s)
     */
    public static JPanel buildAddRemovePropertiesBar(
            JButton add, JButton remove, JButton properties) {
        ButtonBarBuilder2 builder = new ButtonBarBuilder2();
        builder.addButton(add);
        builder.addRelatedGap();
        builder.addButton(remove);
        builder.addRelatedGap();
        builder.addButton(properties);
        return builder.getPanel();
    }
View Full Code Here

   * @return
   */
  protected JComponent getButtonBar(boolean withAutoSaveFunction) {
    // add buttons?
    if (!withAutoSaveFunction || buttons.size() > 0) {
      ButtonBarBuilder2 b = new ButtonBarBuilder2();

      b.addGlue();
      // add buttons
      for (String key : buttons.keySet()) {
        b.addRelatedGap();
        b.addButton(buttons.get(key));
      }

      // add save button?
      if (!withAutoSaveFunction) {
        b.addUnrelatedGap();
        b.addButton(YFactory.b(I18N.t("Speichern"), "disk", new AE() {

          @Override
          public void run() {

            // save all
            for (String key : headers.keySet()) {
              for (String keye : headers.get(key).getElements().keySet()) {
                FormElement e = headers.get(key).get(keye);
                if (e instanceof FormSaveElement) {
                  ((FormSaveElement) e).informListeners();
                }
              }
            }

          }
        }));
      }

      // build layout
      return b.getPanel();

    } else {
      return null;
    }
  }
View Full Code Here

     *
     * @param buttons  an array of buttons to add
     * @return a left aligned button bar with the given buttons
     */
    public static JPanel buildLeftAlignedBar(JButton... buttons) {
        ButtonBarBuilder2 builder = new ButtonBarBuilder2();
        builder.addButton(buttons);
        builder.addGlue();
        return builder.getPanel();
    }
View Full Code Here

     * @return a left aligned button bar with the given buttons
     */
    public static JPanel buildLeftAlignedBar(
            JButton[] buttons,
            boolean  leftToRightButtonOrder) {
        ButtonBarBuilder2 builder = new ButtonBarBuilder2();
        builder.setLeftToRightButtonOrder(leftToRightButtonOrder);
        builder.addButton(buttons);
        builder.addGlue();
        return builder.getPanel();
    }
View Full Code Here

     *
     * @param buttons  an array of buttons to add
     * @return a centered button bar with the given buttons
     */
    public static JPanel buildCenteredBar(JButton... buttons) {
        ButtonBarBuilder2 builder = new ButtonBarBuilder2();
        builder.addGlue();
        builder.addButton(buttons);
        builder.addGlue();
        return builder.getPanel();
    }
View Full Code Here

     *
     * @param buttons  an array of buttons to add
     * @return a filled button bar with the given buttons
     */
    public static JPanel buildGrowingBar(JButton... buttons) {
        ButtonBarBuilder2 builder = new ButtonBarBuilder2();
        builder.addGrowing(buttons);
        return builder.getPanel();
    }
View Full Code Here

     *
     * @param buttons  an array of buttons to add
     * @return a right aligned button bar with the given buttons
     */
    public static JPanel buildRightAlignedBar(JButton... buttons) {
        ButtonBarBuilder2 builder = new ButtonBarBuilder2();
        builder.addGlue();
        builder.addButton(buttons);
        return builder.getPanel();
    }
View Full Code Here

TOP

Related Classes of com.jgoodies.forms.builder.ButtonBarBuilder2

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.