Package com.jgoodies.forms.builder

Examples of com.jgoodies.forms.builder.DefaultFormBuilder


        BrowseAction browse;

    FormLayout layout = new FormLayout(
      "1dlu, 8dlu, left:pref, 4dlu, fill:150dlu, 4dlu, fill:pref","");

    DefaultFormBuilder builder = new DefaultFormBuilder(layout);

    builder.appendSeparator(Globals.lang("External file links"));
    JPanel pan = new JPanel();
    builder.append(pan);
    /**
     * Fix for [ 1749613 ] About translation
     *
     * https://sourceforge.net/tracker/index.php?func=detail&aid=1749613&group_id=92314&atid=600306
     *
     * Cannot really use %0 to refer to the file type, since this ruins translation.
     */
    JLabel lab = new JLabel(Globals.lang("Main file directory") + ":");
    builder.append(lab);
    builder.append(fileDir);
    browse = new BrowseAction(_frame, fileDir, true);
    builder.append(new JButton(browse));
    builder.nextLine();


    builder.append(new JPanel());
        builder.append(matchStartsWithKey, 3);
        builder.nextLine();
        builder.append(new JPanel());
        builder.append(matchExactKeyOnly, 3);
        builder.nextLine();
        builder.append(new JPanel());
        builder.append(useRegExpComboBox);
    builder.append(regExpTextField);
    HelpAction helpAction = new HelpAction(helpDialog, GUIGlobals.regularExpressionSearchHelp,
      Globals.lang("Help on Regular Expression Search"), GUIGlobals.getIconUrl("helpSmall"));
    builder.append(helpAction.getIconButton());
    builder.nextLine();
        builder.append(new JPanel());
        builder.append(runAutoFileSearch, 3);
        builder.nextLine();
    builder.appendSeparator(Globals.lang("Legacy file fields"));
    pan = new JPanel();
    builder.append(pan);   
    builder.append(new JLabel("<html>"+Globals.lang("Note that these settings are used for the legacy "
      +"<b>pdf</b> and <b>ps</b> fields only.<br>For most users, setting the <b>Main file directory</b> "
      +"above should be sufficient.")+"</html>"), 5);
    builder.nextLine();
    pan = new JPanel();
    builder.append(pan);
    lab = new JLabel(Globals.lang("Main PDF directory") + ":");
    builder.append(lab);
    builder.append(pdfDir);
    browse = new BrowseAction(_frame, pdfDir, true);
    builder.append(new JButton(browse));
    builder.nextLine();

        pan = new JPanel();
    builder.append(pan);
    lab = new JLabel(Globals.lang("Main PS directory") + ":");
    builder.append(lab);
    builder.append(psDir);
    browse = new BrowseAction(_frame, psDir, true);
    builder.append(new JButton(browse));
    builder.nextLine();
    builder.appendSeparator(Globals.lang("External programs"));

    builder.nextLine();
   
        addSettingsButton(new PushToLyx(), builder);
        addSettingsButton(new PushToEmacs(), builder);
        addSettingsButton(new PushToWinEdt(), builder);
        addSettingsButton(new PushToVim(), builder);
        addSettingsButton(new PushToLatexEditor(), builder);

        //builder.nextLine();
        builder.append(pan);
        builder.append(editFileTypes);
       
        pan = builder.getPanel();
    pan.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
    add(pan, BorderLayout.CENTER);

    }
View Full Code Here


            frame.unblock();
        }

        boolean commit = true;
        if (!session.getWriter().couldEncodeAll()) {
            DefaultFormBuilder builder = new DefaultFormBuilder(new FormLayout("left:pref, 4dlu, fill:pref", ""));
            JTextArea ta = new JTextArea(session.getWriter().getProblemCharacters());
            ta.setEditable(false);
            builder.append(Globals.lang("The chosen encoding '%0' could not encode the following characters: ",
                      session.getEncoding()));
            builder.append(ta);
            builder.append(Globals.lang("What do you want to do?"));
            String tryDiff = Globals.lang("Try different encoding");
            int answer = JOptionPane.showOptionDialog(frame, builder.getPanel(), Globals.lang("Save database"),
                    JOptionPane.YES_NO_CANCEL_OPTION, JOptionPane.WARNING_MESSAGE, null,
                    new String[] {Globals.lang("Save"), tryDiff, Globals.lang("Cancel")}, tryDiff);

            if (answer == JOptionPane.NO_OPTION) {
                // The user wants to use another encoding.
View Full Code Here

   
    JPanel contactPanel = new JPanel();
    contactPanel.setLayout(new BorderLayout(0, 10));
    horizontalSplitPane.add(contactPanel);
   
    DefaultFormBuilder builder = new DefaultFormBuilder(new FormLayout("min, 3dlu, min, 3dlu, pref:grow, 3dlu, min", ""));
    contactPanel.add(builder.getPanel(), BorderLayout.NORTH);
   
    searchTextField = new JTextField(10);
    EraseTextFieldAction eraseAction = new EraseTextFieldAction(searchTextField) {
      public void actionPerformed(ActionEvent event) {
        super.actionPerformed(event);
        filterAction.actionPerformed(event);
      };
    };
    builder.append(new TabTitleButton(eraseAction));
    filterLabel = new JLabel();
    builder.append(filterLabel);
    builder.append(searchTextField);
    GUIHelper.bindEnterKey(searchTextField, filterAction);
   
    builder.append(Builder.createButton(filterAction));
   
    JPopupMenu tablePopupMenu = new JPopupMenu();
    tablePopupMenu.add(Builder.createMenuItem(newAction));
    tablePopupMenu.addSeparator();   
    tablePopupMenu.add(Builder.createMenuItem(editAction));
View Full Code Here

    super(owner);

    setApplyOnEnter(true);
   
    FormLayout layout = new FormLayout("left:max(40dlu;pref), 3dlu, pref:grow", "");
    DefaultFormBuilder builder = new DefaultFormBuilder(layout);
    builder.setDefaultDialogBorder();
    setMainComponent(builder.getPanel());
   
    firstNameTextField = new JTextField(20);
    firstNameLabel = builder.append("", firstNameTextField);
    builder.nextLine();

    lastNameTextField = new JTextField(20);
    lastNameLabel = builder.append("", lastNameTextField);
    builder.nextLine();

    companyTextField = new JTextField(20);
    companyLabel = builder.append("", companyTextField);
    builder.nextLine();

    faxNumberTextField = new JTextField(20);
    faxNumberLabel = builder.append("", faxNumberTextField);
    builder.nextLine();

    setContact(contact);
    revert();
   
    updateLabels();
View Full Code Here

 
  public AbstractFaxDialog(JFrame owner) {
    super(owner, BUTTON_OKAY | BUTTON_CANCEL);
 
    FormLayout layout = new FormLayout("left:max(40dlu;pref), 3dlu, pref, 3dlu, min, min:grow", "");
    builder = new DefaultFormBuilder(layout);
    builder.setDefaultDialogBorder();
    setMainComponent(builder.getPanel());
   
    parameterAction = new ParameterDialogAction();
    getButtonPanel().add(Builder.createButton(parameterAction), 0);
View Full Code Here

  private SpinnerNumberModel priorityModel;

  public JobPanel(boolean border) {
    FormLayout layout = new FormLayout("left:max(40dlu;pref), 3dlu, pref, pref:grow, min:grow", "");
    DefaultFormBuilder builder = new DefaultFormBuilder(layout, this);
    if (border) {
      builder.setDefaultDialogBorder();
    }
    builder.appendSeparator(i18n.tr("Sender"));
   
    fullnameTextField = new JTextField(DEFAULT_COLUMNS);
    fullnameLabel = builder.append("", fullnameTextField, 3);
    builder.nextLine();

    emailTextField = new JTextField(DEFAULT_COLUMNS);
    emailLabel = builder.append("", emailTextField, 3);
    builder.nextLine();
   
    builder.appendSeparator(i18n.tr("Parameter"));

    notificationModel = new DefaultComboBoxModel();
    JComboBox notificationComboBox = new JComboBox(notificationModel);
    notificationLabel = builder.append("", notificationComboBox, 2);
    builder.nextLine();
   
    resolutionModel = new DefaultComboBoxModel();
    JComboBox resolutionComboBox = new JComboBox(resolutionModel);
    resolutionLabel = builder.append("", resolutionComboBox, 2);
    builder.nextLine();

    priorityModel = new SpinnerNumberModel(0, 0, 255, 1);
    prioritySpinner = new JSpinner(priorityModel);
    priorityLabel = builder.append("", prioritySpinner);
    builder.nextLine();
   
    maxTriesSpinner = new JSpinner(new SpinnerNumberModel(1, 1, 255, 1));
    maxTriesLabel = builder.append("", maxTriesSpinner);
    builder.nextLine();
   
    maxDialsSpinner = new JSpinner(new SpinnerNumberModel(1, 1, 255, 1));
    maxDialsLabel = builder.append("", maxDialsSpinner);
    builder.nextLine();
   
    paperModel = new DefaultComboBoxModel();
    JComboBox paperComboBox = new JComboBox(paperModel);
    paperLabel = builder.append("", paperComboBox, 2);
  }
View Full Code Here

  private void addDocumentsPanel()
  {
    documentFileChooserPanels = new ArrayList<FileChooserPanel>();
   
    FormLayout layout = new FormLayout("left:max(40dlu;pref), 3dlu, pref:grow", "");
    documentPanelBuilder = new DefaultFormBuilder(layout);
    FileChooserPanel documentFileChooserPanel = new MyFileChooserPanel(DEFAULT_COLUMNS);
    documentFileChooserPanel.getFileChooser().setMultiSelectionEnabled(true);
    documentFileChooserPanels.add(documentFileChooserPanel);
    documentLabel = documentPanelBuilder.append("", documentFileChooserPanel);
View Full Code Here

  }

  private void initializeCoverPanel()
  {
    FormLayout layout = new FormLayout("left:max(40dlu;pref), 3dlu, pref:grow", "");
    DefaultFormBuilder builder = new DefaultFormBuilder(layout);
    coverPanel = builder.getPanel();
    this.builder.appendRow(builder.getLineGapSpec());
    this.builder.nextLine();
    this.builder.appendRow("fill:pref:grow");
    this.builder.append(coverPanel, 6);
   
    coverSenderTextField = new JTextField(DEFAULT_COLUMNS);
    coverSenderTextField.setText(Settings.FULLNAME.getValue());
    coverSenderLabel = builder.append("", coverSenderTextField);
    builder.nextLine();
   
    coverRecepientTextField = new JTextField(DEFAULT_COLUMNS);
    coverRecepientLabel = builder.append("", coverRecepientTextField);
    builder.nextLine();
   
    coverSubjectTextField = new JTextField(DEFAULT_COLUMNS);
    coverSubjectLabel = builder.append("", coverSubjectTextField);
    builder.nextLine();
   
    coverCommentTextArea= new JTextArea(3, DEFAULT_COLUMNS);
    coverCommentLabel = builder.append("");
    builder.appendRow("fill:pref:grow"); // second row for text area
    CellConstraints cc = new CellConstraints();
    coverCommentScrollPane = new JScrollPane(coverCommentTextArea);
    builder.add(coverCommentScrollPane,
        cc.xywh(builder.getColumn(), builder.getRow(), 1, 2));
    builder.nextLine(2);
  }
View Full Code Here

    return true;
  }

  private DefaultFormBuilder createForm() {
    FormLayout layout = new FormLayout("left:max(40dlu;pref), 3dlu, pref, pref:grow(0.5), pref:grow(0.5)", "");
    DefaultFormBuilder builder = new DefaultFormBuilder(layout);
    builder.setDefaultDialogBorder();
    return builder;
  }
View Full Code Here

    builder.setDefaultDialogBorder();
    return builder;
  }

  public void initializeConnectionForm() {
    DefaultFormBuilder builder = createForm();
    connectionPanel = builder.getPanel();
    mainTabbedPane.add(connectionPanel);
   
    builder.appendSeparator(i18n.tr("HylaFAX Server"));
   
    hostnameTextField = new JTextField(Constants.DEFAULT_COLUMNS);
    settingMediator.add(Settings.HOSTNAME, hostnameTextField);
    hostnameLabel = builder.append("", hostnameTextField, 3);
    builder.nextLine();
   
    portSpinnerModel = new SpinnerNumberModel();
    portSpinnerModel.setMinimum(PortRange.MIN_PORT);
    portSpinnerModel.setMaximum(PortRange.MAX_PORT);
    settingMediator.add(Settings.PORT, portSpinnerModel);
    portSpinner = new JSpinner(portSpinnerModel);
    portSpinner.setEditor(new JSpinner.NumberEditor(portSpinner, "#"));
    portLabel = builder.append("", portSpinner);
    builder.nextLine();
   
    usePassiveCheckBox = new JCheckBox();
    settingMediator.add(Settings.USE_PASSIVE, usePassiveCheckBox);
    builder.append("", usePassiveCheckBox, 3);
    builder.nextLine();

    builder.appendSeparator(i18n.tr("Authentication"));
   
    usernameTextField = new JTextField(Constants.DEFAULT_COLUMNS);
    settingMediator.add(Settings.USERNAME, usernameTextField);
    usernameLabel = builder.append("", usernameTextField, 3);
    builder.nextLine();

    passwordInfoLabel = new JLabel();
    passwordInfoLabel.setForeground(Color.RED);
    builder.append(passwordInfoLabel, 5);
    builder.nextLine();

    passwordTextField = new JPasswordField(Constants.DEFAULT_COLUMNS);
    settingMediator.add(Settings.PASSWORD, passwordTextField);
    passwordLabel = builder.append("", passwordTextField, 3);
    builder.nextLine();
   
    adminModeCheckBox = new JCheckBox();
    settingMediator.add(Settings.ADMIN_MODE, adminModeCheckBox);   
    adminPasswordTextField = new JPasswordField(Constants.DEFAULT_COLUMNS);
    settingMediator.add(Settings.ADMIN_PASSWORD, adminPasswordTextField);
    builder.append(adminModeCheckBox); builder.append(adminPasswordTextField, 3);
    builder.nextLine();

    adminModeCheckBox.addItemListener(new EnableListener(adminPasswordTextField));
   
    builder.appendSeparator(i18n.tr("Status Update"));

    updateOnStartupCheckBox = new JCheckBox();
    settingMediator.add(Settings.UPDATE_ON_STARTUP, updateOnStartupCheckBox);
    builder.append(updateOnStartupCheckBox, 4);
    builder.nextLine();

    autoUpdateCheckBox = new JCheckBox();
    autoUpdateCheckBox.setEnabled(false);
    settingMediator.add(Settings.DO_AUTO_UPDATE, autoUpdateCheckBox);
    // the auto updater is error prone, therefore it has been disabled
    // until fixed
    //builder.append(autoUpdateCheckBox, 4);
    builder.nextLine();
   
    autoUpdateIntervalModel = new SpinnerNumberModel(1, 1, Integer.MAX_VALUE, 30);
    settingMediator.add(Settings.AUTO_UPDATE_INTERVAL, autoUpdateIntervalModel);
    autoUpdateIntervalSpinner = new JSpinner(autoUpdateIntervalModel);
    autoUpdateIntervalSpinner.setEditor(new JSpinner.NumberEditor(autoUpdateIntervalSpinner, "# s"));
    //autoUpdateIntervalLabel = builder.append("", autoUpdateIntervalSpinner);
    autoUpdateIntervalLabel = new JLabel();
    builder.nextLine();   

    autoUpdateCheckBox.addItemListener(new EnableListener(autoUpdateIntervalSpinner));
  }
View Full Code Here

TOP

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

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.