Package com.jgoodies.forms.builder

Examples of com.jgoodies.forms.builder.ButtonBarBuilder


    JButton ok = new JButton(Globals.lang("Ok")), cancel = new JButton(Globals.lang("Cancel"));
    ok.addActionListener(new OkAction());
    CancelAction cancelAction = new CancelAction();
    cancel.addActionListener(cancelAction);
    lower.setBorder(BorderFactory.createEmptyBorder(2, 2, 2, 2));
    ButtonBarBuilder bb = new ButtonBarBuilder(lower);
    bb.addGlue();
    bb.addGridded(ok);
    bb.addGridded(cancel);
    bb.addGlue();
    // lower.add(ok);
    // lower.add(cancel);

    // Key bindings:
    ActionMap am = chooser.getActionMap();
View Full Code Here


    initOptionsPanel( parent ) ;

    initStatusPanel() ;

    // insert the buttons
    ButtonBarBuilder bb = new ButtonBarBuilder();
    JPanel buttonPanel = bb.getPanel();
    buttonPanel.setBorder(BorderFactory.createEmptyBorder(2,2,2,2));

    bb.addGlue();
    bb.addGridded( generateButton ) ;
    bb.addGridded( okButton );
    bb.addGridded( cancelButton );
    bb.addGlue();
    this.setModal( true ) ;
    this.setResizable( false ) ;
    this.setTitle( Globals.lang( "AUX file import" ) ) ;
    getContentPane().add( panel1 ) ;
View Full Code Here


            JPanel main = builder.getPanel();
            main.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));

            ButtonBarBuilder bb = new ButtonBarBuilder();
            bb.addGlue();
            bb.addGridded(ok);
            bb.addGridded(cancel);
            bb.addGlue();
            getContentPane().add(main, BorderLayout.CENTER);
            getContentPane().add(bb.getPanel(), BorderLayout.SOUTH);

            pack();
        }
View Full Code Here

            icons.setSelectedIndex(initSelIndex);
        icons.setCellRenderer(new MyRenderer());
        icons.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
        icons.setLayoutOrientation(JList.HORIZONTAL_WRAP);

        ButtonBarBuilder bb = new ButtonBarBuilder();
        bb.addGlue();
        bb.addGridded(ok);
        bb.addGridded(cancel);
        bb.addGlue();
        bb.getPanel().setBorder(BorderFactory.createEmptyBorder(5,5,5,5));

        ok.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent actionEvent) {
                okPressed = true;
                if (icons.getSelectedValue() != null)
                    selected = icons.getSelectedIndex();
                dispose();
            }
        });
        cancel.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent actionEvent) {
                okPressed = false;
                dispose();
            }
        });
        icons.addMouseListener(new MouseAdapter() {
            public void mouseClicked(MouseEvent e) {
                if (e.getClickCount() == 2) {

                }
            }
        });

        getContentPane().add(new JScrollPane(icons), BorderLayout.CENTER);
        getContentPane().add(bb.getPanel(), BorderLayout.SOUTH);

        pack();
        setLocationRelativeTo(parent);
    }
View Full Code Here

        //builder.append(Util.nCase(fieldName));//(editor.getLabel());
        builder.appendSeparator(Util.nCase(fieldName));
        builder.append(editor.getTextComponent());
        builder.append(browse);

        ButtonBarBuilder bb = new ButtonBarBuilder();
        bb.addGridded(download);
        bb.addGridded(auto);
        builder.nextLine();
        builder.append(bb.getPanel());
        builder.nextLine();
        builder.appendSeparator();

        main = builder.getPanel();

        main.setBorder(BorderFactory.createEmptyBorder(5,5,5,5));

        bb = new ButtonBarBuilder();
        bb.addGlue();
        bb.addGridded(ok);
        bb.addGridded(cancel);
        bb.addGlue();


        getContentPane().add(main, BorderLayout.CENTER);
        getContentPane().add(bb.getPanel(), BorderLayout.SOUTH);
        pack();
    }
View Full Code Here

            builder.append(browseBut);
        } else {
            builder.append(application);
            builder.append(browseBut);
        }
        ButtonBarBuilder bb = new ButtonBarBuilder();
        bb.addGlue();
        bb.addGridded(ok);
        bb.addGridded(cancel);
        bb.addGlue();

        ok.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                okPressed = true;
                storeSettings(ExternalFileTypeEntryEditor.this.entry);
                diag.dispose();
                               
            }
        });
        cancel.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                diag.dispose();
            }
        });

        icon.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent actionEvent) {
                String initSel = ExternalFileTypeEntryEditor.this.entry.getIconName();
                if (selectedIcon != null)
                    initSel = selectedIcon;
                IconSelection ic = new IconSelection(diag, initSel);
                ic.setVisible(true);
                if (ic.isOkPressed()) {
                    selectedIcon = ic.getSelectedIconKey();
                    icon.setIcon(GUIGlobals.getImage(selectedIcon));
                }
                //JOptionPane.showMessageDialog(null, "Sorry, the icon can unfortunately not be changed in this version of JabRef");
            }
        });

        if (Globals.ON_WIN) {
            application.getDocument().addDocumentListener(new DocumentListener() {
                private void handle(DocumentEvent e) {
                    if (application.getText().length() == 0) {
                        useDefault.setSelected(true);
                    } else {
                        other.setSelected(true);
                    }
                }
                public void insertUpdate(DocumentEvent e) {
                    handle(e);
                }

                public void removeUpdate(DocumentEvent documentEvent) {
                    handle(documentEvent);
                }

                public void changedUpdate(DocumentEvent documentEvent) {
                    handle(documentEvent);
                }
            });
        }

        if (dParent != null)
            diag = new JDialog(dParent, Globals.lang("Edit file type"), true);
        else
            diag = new JDialog(fParent, Globals.lang("Edit file type"), true);
        diag.getContentPane().add(builder.getPanel(), BorderLayout.CENTER);
        diag.getContentPane().add(bb.getPanel(), BorderLayout.SOUTH);
        diag.pack();

        BrowseListener browse = new BrowseListener(diag, application);
        browseBut.addActionListener(browse);
View Full Code Here

        else
            dg = new JDialog((JFrame)parent, Globals.lang("Settings"), true);
        final JDialog diag = dg;
        options.setBorder(BorderFactory.createEmptyBorder(5,5,5,5));
        diag.getContentPane().add(options, BorderLayout.CENTER);
        ButtonBarBuilder bb = new ButtonBarBuilder();
        JButton ok = new JButton(Globals.lang("Ok"));
        JButton cancel = new JButton(Globals.lang("Cancel"));
        bb.addGlue();
        bb.addGridded(ok);
        bb.addGridded(cancel);
        bb.addGlue();
        bb.getPanel().setBorder(BorderFactory.createEmptyBorder(5,5,5,5));
        diag.getContentPane().add(bb.getPanel(), BorderLayout.SOUTH);
        ok.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent event) {
                okPressed.value = true;
                diag.dispose();
            }
        });
        cancel.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent event) {
                diag.dispose();
            }
        });
        // Key bindings:
        ActionMap am = bb.getPanel().getActionMap();
        InputMap im = bb.getPanel().getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW);
        im.put(Globals.prefs.getKey("Close dialog"), "close");
        am.put("close", new AbstractAction() {
            public void actionPerformed(ActionEvent e) {
                diag.dispose();
            }
View Full Code Here

                builderSG.append(m_sgRegExp, 3);
                m_optionsPanel.add(builderSG.getPanel(), "" + INDEX_SEARCHGROUP);
                // ... for buttons panel
                FormLayout layoutBP = new FormLayout("pref, 4dlu, pref", "p");
                layoutBP.setColumnGroups(new int[][] { { 1, 3 } });
                ButtonBarBuilder builderBP = new ButtonBarBuilder();
                builderBP.addGlue();
                builderBP.addGridded(m_ok);
                builderBP.addGridded(m_cancel);
                builderBP.addGlue();
                builderBP.getPanel().setBorder(BorderFactory.createEmptyBorder(5,5,5,5));

                // create layout
                FormLayout layoutAll = new FormLayout(
                                "right:pref, 4dlu, fill:600px, 4dlu, fill:pref",
                                "p, 3dlu, p, 3dlu, p, 0dlu, p, 0dlu, p, 3dlu, p, 3dlu, p, "
                                                + "0dlu, p, 0dlu, p, 3dlu, p, 3dlu, "
                                                + "p, 3dlu, p, 3dlu, top:80dlu, 9dlu, p, 9dlu, p");

                DefaultFormBuilder builderAll = new DefaultFormBuilder(layoutAll);
                builderAll.setDefaultDialogBorder();
                builderAll.appendSeparator(Globals.lang("General"));
                builderAll.nextLine();
                builderAll.nextLine();
                builderAll.append(Globals.lang("Name"));
                builderAll.append(m_name);
                builderAll.nextLine();
                builderAll.nextLine();
                builderAll.append(m_explicitRadioButton, 5);
                builderAll.nextLine();
                builderAll.nextLine();
                builderAll.append(m_keywordsRadioButton, 5);
                builderAll.nextLine();
                builderAll.nextLine();
                builderAll.append(m_searchRadioButton, 5);
                builderAll.nextLine();
                builderAll.nextLine();
                builderAll.appendSeparator(Globals.lang("Hierarchical context")); // JZTODO lyrics
                builderAll.nextLine();
                builderAll.nextLine();
                builderAll.append(m_independentButton, 5);
                builderAll.nextLine();
                builderAll.nextLine();
                builderAll.append(m_intersectionButton, 5);
                builderAll.nextLine();
                builderAll.nextLine();
                builderAll.append(m_unionButton, 5);
                builderAll.nextLine();
                builderAll.nextLine();
                builderAll.appendSeparator(Globals.lang("Options"));
                builderAll.nextLine();
                builderAll.nextLine();
                builderAll.append(m_optionsPanel, 5);
                builderAll.nextLine();
                builderAll.nextLine();
                builderAll.appendSeparator(Globals.lang("Description"));
                builderAll.nextLine();
                builderAll.nextLine();
                JScrollPane sp = new JScrollPane(m_description,
                                JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED,
                                JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED) {
                        public Dimension getPreferredSize() {
                                return getMaximumSize();
                        }
                };
                builderAll.append(sp, 5);
                builderAll.nextLine();
                builderAll.nextLine();
                builderAll.appendSeparator();
                builderAll.nextLine();
                builderAll.nextLine();
                //CellConstraints cc = new CellConstraints();
                //builderAll.add(builderBP.getPanel(), cc.xyw(builderAll.getColumn(),
                //                builderAll.getRow(), 5, "center, fill"));

                Container cp = getContentPane();
                //cp.setLayout(new BoxLayout(cp, BoxLayout.Y_AXIS));
                cp.add(builderAll.getPanel(), BorderLayout.CENTER);
                cp.add(builderBP.getPanel(), BorderLayout.SOUTH);
                pack();
                setResizable(false);
                updateComponents();
                setLayoutForSelectedGroup();
                Util.placeDialog(this, m_parent);
View Full Code Here

            builder.nextLine();
            builder.append(downloadLabel);
            builder.append(prog, 3);
        }
       
        ButtonBarBuilder bb = new ButtonBarBuilder();
        bb.addGlue();
        //bb.addGridded(open);
        //bb.addRelatedGap();
        bb.addRelatedGap();
        bb.addGridded(ok);
        bb.addGridded(cancel);
        bb.addGlue();


        ok.addActionListener(okAction);
        // Add OK action to the two text fields to simplify entering:
        link.addActionListener(okAction);
        description.addActionListener(okAction);

        open.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent actionEvent) {
                openFile();
            }
        });

        AbstractAction cancelAction = new AbstractAction() {
                public void actionPerformed(ActionEvent e) {
                    diag.dispose();
                }
            };
        cancel.addActionListener(cancelAction);


        // Key bindings:
        ActionMap am = builder.getPanel().getActionMap();
        InputMap im = builder.getPanel().getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW);
        im.put(Globals.prefs.getKey("Close dialog"), "close");
        am.put("close", cancelAction);

        link.getDocument().addDocumentListener(new DocumentListener() {
            public void insertUpdate(DocumentEvent documentEvent) {
                checkExtension();
            }
            public void removeUpdate(DocumentEvent documentEvent) {
            }
            public void changedUpdate(DocumentEvent documentEvent) {
                checkExtension();
            }

        });


        diag = new JDialog(frame, Globals.lang("Edit file link"), true);
        diag.getContentPane().add(builder.getPanel(), BorderLayout.CENTER);
        diag.getContentPane().add(bb.getPanel(), BorderLayout.SOUTH);
        diag.pack();
        Util.placeDialog(diag, frame);
        diag.addWindowListener(new WindowAdapter() {
            public void windowActivated(WindowEvent event) {
                if (openBrowseWhenShown && !dontOpenBrowseUntilDisposed) {
View Full Code Here

    //jPanel3.setBackground(GUIGlobals.lightGray);
    revert.setText(Globals.lang("Default"));
    revert.addActionListener(new GenFieldsCustomizer_revert_actionAdapter(this));
    this.getContentPane().add(buttons, BorderLayout.SOUTH);
    ButtonBarBuilder bb = new ButtonBarBuilder(buttons);
    buttons.setBorder(BorderFactory.createEmptyBorder(2,2,2,2));
    bb.addGlue();
    bb.addGridded(ok);
    bb.addGridded(revert);
    bb.addGridded(cancel);
    bb.addStrut(Sizes.DLUX5);
    bb.addGridded(helpBut);
    bb.addGlue();
   
    this.getContentPane().add(jPanel3, BorderLayout.CENTER);
    jPanel3.add(jLabel1,    new GridBagConstraints(0, 1, 1, 1, 1.0, 0.0
            ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0));
    jPanel3.add(jPanel4,   new GridBagConstraints(0, 0, 1, 1, 1.0, 1.0
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.