Package com.jgoodies.forms.builder

Examples of com.jgoodies.forms.builder.ButtonBarBuilder


        setResizable(false);
        pagePanel.setLayout(cardLayout);
        getContentPane().setLayout(new BorderLayout());
        getContentPane().add(pagePanel, BorderLayout.CENTER);
        getContentPane().add(buttonPanel, BorderLayout.SOUTH);
        ButtonBarBuilder buttonBarBuilder = new ButtonBarBuilder(buttonPanel);
        buttonBarBuilder.addGlue();
        buttonBarBuilder.addGridded(backButton);
        //buttonBarBuilder.addRelatedGap();
        buttonBarBuilder.addGridded(nextButton);
        buttonBarBuilder.addUnrelatedGap();
        buttonBarBuilder.addGridded(cancelButton);
        buttonBarBuilder.setDefaultDialogBorder();

        backButton.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                gotoPreviousPage();
            }
View Full Code Here


    statusProgress.setEnabled(false);

    CloseAction closeAction = new CloseAction();
    GUIUtil.configureEscapeKey(getRootPane(), closeAction);

    ButtonBarBuilder bbb = new ButtonBarBuilder();
    JButton startButton = new JButton(startAction);
    JButton stopButton = new JButton(stopAction);
    JButton closeButton = new JButton(closeAction);
    bbb.addGridded(startButton);
    bbb.addRelatedGap();
    bbb.addGridded(stopButton);
    bbb.addGlue();
    bbb.addGridded(closeButton);

    FormLayout formLayout = new FormLayout("fill:200dlu:grow", "pref, 4dlu, pref, 7dlu, pref");
    PanelBuilder panelBuilder = new PanelBuilder(formLayout);
    panelBuilder.setDefaultDialogBorder();
    panelBuilder.add(statusLabel, "1,1");
    panelBuilder.add(statusProgress, "1,3");
    panelBuilder.add(bbb.getPanel(), "1,5");
    setContentPane(panelBuilder.getPanel());

    pack();
  }
View Full Code Here

          cancelAction.actionPerformed(null);
        }
      });
    getRootPane().setDefaultButton(okButton);

    ButtonBarBuilder buttonBuilder = new ButtonBarBuilder();
    buttonBuilder.setBorder(Borders.createEmptyBorder(Sizes.DLUY4, Sizes.DLUX7, Sizes.DLUY7, Sizes.DLUX7));
    initButtonBar(buttonBuilder);
    buttonBuilder.addGlue();
    if (Platform.isMacOSXAqua()) {
      buttonBuilder.addGridded(cancelButton);
      buttonBuilder.addRelatedGap();
      buttonBuilder.addGridded(okButton);
    } else {
      buttonBuilder.addGridded(okButton);
      buttonBuilder.addRelatedGap();
      buttonBuilder.addGridded(cancelButton);
    }

    Container c = getContentPane();
    c.setLayout(new BorderLayout());
    if (banner != null) {
      c.add(banner, BorderLayout.NORTH);
    }
    c.add(mainComponent, BorderLayout.CENTER);
    c.add(buttonBuilder.getPanel(), BorderLayout.SOUTH);

    setResizable(false);
    setModal(true);
    pack();
  }
View Full Code Here

    conversion.addConversionListener(conversionPane);
    conversion.addSpiderListener(conversionPane);
    conversion.addRecordListener(conversionPane);
    conversionPane.setConversion(conversion);

    ButtonBarBuilder bbb=new ButtonBarBuilder();
    bbb.addGlue();
    bbb.addGridded(new JButton(cancelAction));
    bbb.addGlue();
    GUIUtil.configureEscapeKey(getRootPane(), cancelAction);

    FormLayout formLayout = new FormLayout("fill:pref:grow", "fill:pref:grow, 7dlu, pref");
    PanelBuilder panelBuilder = new PanelBuilder(formLayout);
    panelBuilder.setDefaultDialogBorder();
    panelBuilder.add(conversionPane, "1,1");
    panelBuilder.add(bbb.getPanel(), "1,3");
   
    setContentPane(panelBuilder.getPanel());   
    pack();

    addWindowListener(new WindowAdapter() {       
View Full Code Here

    FormLayout formLayout = new FormLayout("center:pref", "pref:grow, 4dlu, pref");
    PanelBuilder panelBuilder = new PanelBuilder(formLayout);
    panelBuilder.setDefaultDialogBorder();
    panelBuilder.add(tabbedPane, new CellConstraints(1, 1));

    ButtonBarBuilder buttonBarBuilder = new ButtonBarBuilder();
    buttonBarBuilder.addGridded(closeButton);
    panelBuilder.add(buttonBarBuilder.getPanel(), new CellConstraints(1, 3));
    getContentPane().add(panelBuilder.getPanel(), BorderLayout.CENTER);

    formLayout = new FormLayout("0dlu, center:pref, 0dlu", "0dlu, center:pref, 4dlu, pref, 0dlu");
    panelBuilder = new PanelBuilder(formLayout);
View Full Code Here

        return pane;
    }

    private Component createButtonsPanel() {

        ButtonBarBuilder buttons = new ButtonBarBuilder();
        buttons.setDefaultDialogBorder();
        buttons.addGlue();
        buttons.addGridded(new JButton(new AbstractAction("Ok") {
            @Override
            public void actionPerformed(ActionEvent e) {
                saveSettings();

                EventManager.fireEvent(new Event(Event.EVENT_SETTINGS_CHANGED));

                dialog.dispose();
            }
        }));
        buttons.addUnrelatedGap();
        buttons.addGridded(new JButton(new AbstractAction("Cancel") {
            @Override
            public void actionPerformed(ActionEvent e) {
                dialog.dispose();
            }
        }));

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

        return legend;
    }

    private void buildLegend() {
        ButtonBarBuilder builder = new ButtonBarBuilder();

        builder.addFixed(new JLabel("ThreadCount", createLegendIcon(THREADCOUNT_COLOR), JLabel.LEFT));
        builder.addUnrelatedGap();
        builder.addFixed(new JLabel("Total", createLegendIcon(TOTAL_COLOR), JLabel.LEFT));
        builder.setBorder(BorderFactory.createEmptyBorder(3, 3, 3, 3));

        legend = builder.getPanel();
    }
View Full Code Here

        requestHostFilterCombo = UISupport.setFixedSize(new JComboBox(requestFilterModel), comboBoxSize);

        // toolbar.addFixed( new JLabel( "<html><b>Filter:</b></html>"));
        // toolbar.addUnrelatedGap();

        ButtonBarBuilder toolbar = new ButtonBarBuilder();

        toolbar.addFixed(new JLabel("Request Host"));
        toolbar.addRelatedGap();
        toolbar.addFixed(requestHostFilterCombo);
        toolbar.addUnrelatedGap();

        requestHostFilterCombo.addItemListener(new ItemListener() {
            public void itemStateChanged(ItemEvent e) {
                int ix = requestHostFilterCombo.getSelectedIndex();
                if (ix == -1) {
                    return;
                }

                requestHostFilter.setAcceptNull(ix == 0);

                if (ix == 0) {
                    requestHostFilter.setPattern(".*", 0);
                } else {
                    requestHostFilter.setPattern(requestHostFilterCombo.getSelectedItem().toString(), 0);
                }

                updateRowCountLabel();
            }
        });

        toolbar.addFixed(new JLabel("Target Host"));
        toolbar.addRelatedGap();
        targetHostFilterCombo = UISupport.setFixedSize(new JComboBox(targetHostFilterModel), comboBoxSize);
        toolbar.addFixed(targetHostFilterCombo);
        toolbar.addUnrelatedGap();

        targetHostFilterCombo.addItemListener(new ItemListener() {
            public void itemStateChanged(ItemEvent e) {
                int ix = targetHostFilterCombo.getSelectedIndex();
                if (ix == -1) {
                    return;
                }

                targetHostFilter.setAcceptNull(ix == 0);

                if (ix == 0) {
                    targetHostFilter.setPattern(".*", 0);
                } else {
                    targetHostFilter.setPattern(targetHostFilterCombo.getSelectedItem().toString(), 0);
                }

                updateRowCountLabel();
            }
        });

        String[] interfaceNames = ModelSupport.getNames(new String[]{ALL_FILTER_OPTION},
                ModelSupport.getChildren(getProject(), WsdlInterface.class));

        toolbar.addFixed(new JLabel("Interface"));
        toolbar.addRelatedGap();
        interfaceFilterCombo = UISupport.setFixedSize(new JComboBox(interfaceNames), comboBoxSize);
        toolbar.addFixed(interfaceFilterCombo);
        toolbar.addUnrelatedGap();

        operationFilterModel = new DefaultComboBoxModel(new String[]{ALL_FILTER_OPTION});
        interfaceFilterCombo.addItemListener(new ItemListener() {
            public void itemStateChanged(ItemEvent e) {
                String item = (String) interfaceFilterCombo.getSelectedItem();
                operationFilterModel.removeAllElements();

                if (item == null || getProject().getInterfaceByName(item) == null) {
                    operationFilterModel.addElement(ALL_FILTER_OPTION);
                    interfaceFilter.setPattern(".*", 0);
                } else if (getProject().getInterfaceByName(item) != null) {
                    WsdlInterface iface = (WsdlInterface) getProject().getInterfaceByName(item);
                    String[] operationNames = ModelSupport.getNames(new String[]{ALL_FILTER_OPTION},
                            iface.getOperationList());
                    for (String s : operationNames) {
                        operationFilterModel.addElement(s);
                    }

                    interfaceFilter.setPattern(iface.getName(), 0);
                }
            }
        });

        toolbar.addFixed(new JLabel("Operation"));
        toolbar.addRelatedGap();
        operationFilterCombo = UISupport.setFixedSize(new JComboBox(operationFilterModel), comboBoxSize);
        toolbar.addFixed(operationFilterCombo);

        operationFilterCombo.addItemListener(new ItemListener() {
            public void itemStateChanged(ItemEvent e) {
                int ix = operationFilterCombo.getSelectedIndex();
                if (ix == -1) {
                    operationFilter.setPattern(".*", 0);
                    updateRowCountLabel();
                    return;
                }

                operationFilter.setAcceptNull(ix == 0);

                if (ix == 0) {
                    operationFilter.setPattern(".*", 0);
                } else {
                    operationFilter.setPattern(operationFilterCombo.getSelectedItem().toString(), 0);
                }

                updateRowCountLabel();
            }
        });

        toolbar.setBorder(BorderFactory.createEmptyBorder(3, 2, 3, 0));
        return toolbar.getPanel();
    }
View Full Code Here

    public FileFormField(String tooltip, FieldType type, String name) {
        super(new JPanel());
        this.type = type;

        ButtonBarBuilder builder = new ButtonBarBuilder(getComponent());
        textField = new JUndoableTextField(30);
        textField.setName(name);
        textField.setToolTipText(tooltip);
        builder.addGriddedGrowing(textField);
        builder.addRelatedGap();
        selectDirectoryButton = new JButton(new SelectDirectoryAction());
        builder.addFixed(selectDirectoryButton);

        textField.getDocument().addDocumentListener(new DocumentListenerAdapter() {

            @Override
            public void update(Document document) {
View Full Code Here

        splitPane.setDividerLocation(150);
        splitPane.setBorder(BorderFactory.createEmptyBorder(0, 1, 0, 1));

        contentPanel.add(splitPane, BorderLayout.CENTER);

        ButtonBarBuilder builder = new ButtonBarBuilder();

        ShowOnlineHelpAction showOnlineHelpAction = new ShowOnlineHelpAction(HelpUrls.XQUERYASSERTIONEDITOR_HELP_URL);
        builder.addFixed(UISupport.createToolbarButton(showOnlineHelpAction));
        builder.addGlue();

        JButton okButton = new JButton(new OkAction());
        builder.addFixed(okButton);
        builder.addRelatedGap();
        builder.addFixed(new JButton(new CancelAction()));

        builder.setBorder(BorderFactory.createEmptyBorder(1, 5, 5, 5));

        contentPanel.add(builder.getPanel(), BorderLayout.SOUTH);

        configurationDialog.setContentPane(contentPanel);
        configurationDialog.setSize(600, 500);
        configurationDialog.setModal(true);
        UISupport.initDialogActions(configurationDialog, showOnlineHelpAction, okButton);
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.