Package com.jgoodies.forms.builder

Examples of com.jgoodies.forms.builder.ButtonBarBuilder


     *
     * @return bar.
     */
    protected Component buildButtonsBar()
    {
        ButtonBarBuilder builder = new ButtonBarBuilder();

        builder.getPanel().setBorder(Constants.DIALOG_BUTTON_BAR_BORDER);
        builder.addFixed(spnProgress);
        builder.addUnrelatedGap();
        builder.addGlue();
        addCustomButtons(builder);
        builder.addGriddedButtons(new JButton[] { btnPostToBlog, btnCancel });

        return builder.getPanel();
    }
View Full Code Here


    // Button DesignGrids ***************************************************

    private Component buildButtonFormNoNarrow() {
        JButton[] buttons = createButtons();
        ButtonBarBuilder builder = new ButtonBarBuilder();
        builder.setOpaque(false);
        for (int i = 0; i < buttons.length - 1; i++) {
            builder.addGridded(buttons[i]);
            builder.addRelatedGap();
        }
        builder.addFixed(buttons[buttons.length - 1]);

        JPanel panel = new JPanel(new BorderLayout());
        panel.add(builder.getPanel(), BorderLayout.CENTER);
        panel.setOpaque(false);
        panel.setBorder(new CompoundBorder(
                new TitledBorder("Adjusted Button Widths (FormLayout)"),
                new EmptyBorder(14, 14, 14, 14)));
        return panel;
View Full Code Here

      " o the button order is fixed left-to-right,\n" +
            " o gaps may be inconsistent between team members.");
    }

    private Component buildButtonBar2Panel() {
        ButtonBarBuilder builder = new ButtonBarBuilder();
        builder.addGlue();
        builder.addGriddedButtons(new JButton[] {
                new JButton("Yes"),
                new JButton("No")
                });
        return wrap(builder.getPanel(),
            "This bar has been built with a ButtonBarBuilder:\n" +
            " o buttons have a minimum widths,\n" +
      " o the button order honors the platform default,\n" +
        " o the button gap is a logical size that follows a style guide.");
    }
View Full Code Here

      " o the button order honors the platform default,\n" +
        " o the button gap is a logical size that follows a style guide.");
    }

    private Component buildButtonBar3Panel() {
        ButtonBarBuilder builder = new ButtonBarBuilder();
        builder.addGlue();
        builder.addGridded(new JButton("One"));
        builder.addRelatedGap();
        builder.addGridded(new JButton("Two"));
        builder.addRelatedGap();
        builder.addGridded(new JButton("Three"));
        return wrap(builder.getPanel(),
            "This bar uses the logical gap for related buttons.\n");
    }
View Full Code Here

        return wrap(builder.getPanel(),
            "This bar uses the logical gap for related buttons.\n");
    }

    private Component buildButtonBar4Panel() {
        ButtonBarBuilder builder = new ButtonBarBuilder();
        builder.addGlue();
        builder.addGridded(new JButton("One"));
        builder.addUnrelatedGap();
        builder.addGridded(new JButton("Two"));
        builder.addUnrelatedGap();
        builder.addGridded(new JButton("Three"));

        return wrap(builder.getPanel(),
            "This bar uses the logical gap for unrelated buttons.\n" +
            "It is a little bit wider than the related gap.");
    }
View Full Code Here

            "This bar uses the logical gap for unrelated buttons.\n" +
            "It is a little bit wider than the related gap.");
    }

    private Component buildButtonMixedBar1Panel() {
        ButtonBarBuilder builder = new ButtonBarBuilder();
        builder.addGridded(new JButton("Help"));
        builder.addUnrelatedGap();
        builder.addGlue();
        builder.addFixed(new JButton("Copy to Clipboard"));
        builder.addUnrelatedGap();
        builder.addGriddedButtons(new JButton[] {
                new JButton("OK"),
                new JButton("Cancel")
          });
        return wrap(builder.getPanel(),
            "Demonstrates a glue (between Help and the rest),\n" +
            "has related and unrelated buttons and an ungridded button\n" +
            "with a default margin (Copy to Clipboard).");
    }
View Full Code Here

            "has related and unrelated buttons and an ungridded button\n" +
            "with a default margin (Copy to Clipboard).");
    }

    private Component buildButtonMixedBar2Panel() {
        ButtonBarBuilder builder = new ButtonBarBuilder();
        builder.addGridded(new JButton("Help"));
        builder.addUnrelatedGap();
        builder.addGlue();
        builder.addFixedNarrow(new JButton("Copy to Clipboard"));
        builder.addUnrelatedGap();
        builder.addGriddedButtons(new JButton[] {
                new JButton("OK"),
                new JButton("Cancel")
        });
        return wrap(builder.getPanel(),
            "Demonstrates a glue (between Help and the rest),\n" +
            "has related and unrelated buttons and an ungridded button\n" +
            "with a narrow margin (Copy to Clipboard).\n\n"+
      "Note that some look&feels do not support the narrow margin\n" +
      "feature, and conversely, others have only narrow margins.");
View Full Code Here

     * Builds and returns the message dialog button bar.
     *
     * @return the message dialog button bar
     */
    private JPanel buildButtonBar() {
        ButtonBarBuilder builder = new ButtonBarBuilder();
        builder.setOpaque(false);
        builder.addGriddedButtons(new JButton[]{
            informationButton, warningButton, questionButton, errorButton});
        return builder.getPanel();
    }
View Full Code Here

        rowBuilder.appendSeparator("Right to Left");
        rowBuilder.append("Ordered:", buildButtonSequence(createRightToLeftBuilder()));
        rowBuilder.append("Fixed:",   buildIndividualButtons(createRightToLeftBuilder()));

        rowBuilder.appendSeparator("Platform Default Order");
        rowBuilder.append("Ordered:", buildButtonSequence(new ButtonBarBuilder()));
        rowBuilder.append("Fixed:",   buildIndividualButtons(new ButtonBarBuilder()));

        return rowBuilder.getPanel();
    }
View Full Code Here

     * this method is useful for demonstration purposes only.
     *
     * @return a ButtonBarBuilder with right-to-left button order
     */
    private static ButtonBarBuilder createRightToLeftBuilder() {
        ButtonBarBuilder builder = new ButtonBarBuilder();
        builder.setLeftToRightButtonOrder(false);
        return builder;
    }
View Full Code Here

TOP

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

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.