Example usage for com.jgoodies.forms.builder DefaultFormBuilder DefaultFormBuilder

List of usage examples for com.jgoodies.forms.builder DefaultFormBuilder DefaultFormBuilder

Introduction

In this page you can find the example usage for com.jgoodies.forms.builder DefaultFormBuilder DefaultFormBuilder.

Prototype

public DefaultFormBuilder(FormLayout layout) 

Source Link

Document

Constructs a DefaultFormBuilder for the given layout.

Usage

From source file:com.projity.dialog.calendar.NewBaseCalendarDialog.java

License:Common Public License

/**
 * Builds the panel. Initializes and configures components first, then
 * creates a FormLayout, configures the layout, creates a builder, sets a
 * border, and finally adds the components.
 * /* w  ww .  ja  v  a2s. com*/
 * @return the built panel
 */

public JComponent createContentPanel() {
    initControls();

    // Separating the component initialization and configuration
    // from the layout code makes both parts easier to read.
    FormLayout layout = new FormLayout("p, 3dlu, 100dlu", // cols //$NON-NLS-1$
            "p, 3dlu,p, 3dlu, p, 3dlu, p, 3dlu, p"); // rows //$NON-NLS-1$

    // Create a builder that assists in adding components to the container.
    // Wrap the panel with a standardized border.
    DefaultFormBuilder builder = new DefaultFormBuilder(layout);
    builder.setDefaultDialogBorder();
    CellConstraints cc = new CellConstraints();
    builder.append(Messages.getString("NewBaseCalendarDialog.Name"), name); //$NON-NLS-1$
    builder.nextLine(2);
    builder.append(createNewBase);
    builder.nextLine(2);
    builder.append(makeACopy);
    builder.append(calendarToCopy);
    return builder.getPanel();
}

From source file:com.projity.dialog.ColumnDialog.java

License:Common Public License

/**
 * Builds the panel. Initializes and configures components first, then
 * creates a FormLayout, configures the layout, creates a builder, sets a
 * border, and finally adds the components.
 * /*from w  w w .  j  ava2 s.c  o m*/
 * @return the built panel
 */

public JComponent createContentPanel() {
    // Separating the component initialization and configuration
    // from the layout code makes both parts easier to read.
    initControls();
    //TODO set minimum size
    FormLayout layout = new FormLayout("default, 3dlu, 120dlu:grow", // cols //$NON-NLS-1$
            "p"); // rows //$NON-NLS-1$

    // Create a builder that assists in adding components to the container.
    // Wrap the panel with a standardized border.
    DefaultFormBuilder builder = new DefaultFormBuilder(layout);
    builder.setDefaultDialogBorder();
    builder.append(Messages.getString("Text.Field"), combo); //$NON-NLS-1$
    return builder.getPanel();
}

From source file:com.projity.dialog.DelegateTaskDialog.java

License:Common Public License

public JComponent createContentPanel() {
    taskNames = new JLabel();
    String names = DataUtils.stringListWithMaxAndMessage(getCollection(), Settings.STRING_LIST_LIMIT,
            Messages.getString("Message.tooManyTasksSelectedToList.mf")); //$NON-NLS-1$
    taskNames.setText(Messages.getString("Text.Tasks") + ": " + names); //$NON-NLS-1$ //$NON-NLS-2$

    FieldComponentMap map = createMap();

    FormLayout layout = new FormLayout("p, 3dlu, p" //$NON-NLS-1$
            , "p,3dlu,p"); //$NON-NLS-1$

    DefaultFormBuilder builder = new DefaultFormBuilder(layout);
    builder.setDefaultDialogBorder();/*  w ww .  j av a 2s  . co  m*/
    CellConstraints cc = new CellConstraints();

    // task names span whole dialog
    builder.add(taskNames, cc.xyw(builder.getColumn(), builder.getRow(), builder.getColumnCount()));
    builder.nextLine(2);
    map.append(builder, "Field.delegatedTo"); //$NON-NLS-1$
    return builder.getPanel();
}

From source file:com.projity.dialog.DependencyDialog.java

License:Common Public License

public JComponent createContentPanel() {
    // Separating the component initialization and configuration
    // from the layout code makes both parts easier to read.
    initControls();/*from  w  w  w  .j  a v a  2s .  c o  m*/
    //TODO set minimum size
    FormLayout layout = new FormLayout("50dlu,3dlu,50dlu,3dlu,50dlu,3dlu,50dlu", // cols
            "p,3dlu,p,3dlu,p,3dlu,p,3dlu"); // rows

    // Create a builder that assists in adding components to the container.
    // Wrap the panel with a standardized border.
    DefaultFormBuilder builder = new DefaultFormBuilder(layout);
    builder.setDefaultDialogBorder();
    CellConstraints cc = new CellConstraints();
    builder.append(Messages.getString("Text.From") + ":");
    builder.add(preLabel, cc.xyw(builder.getColumn(), builder.getRow(), 5));
    builder.nextLine(2);
    builder.append(Messages.getString("Text.To") + ":");
    builder.add(sucLabel, cc.xyw(builder.getColumn(), builder.getRow(), 5));

    builder.nextLine(2);
    builder.append(Messages.getString("Text.Type") + ":", typeCombo);

    builder.addLabel(Messages.getString("Text.Lag") + ":");
    builder.nextColumn(2);
    builder.add(lagTextField);

    return builder.getPanel();
}

From source file:com.projity.dialog.DonateDialog.java

License:Common Public License

public JComponent createContentPanel() {
    FormLayout layout = new FormLayout("default", // cols //$NON-NLS-1$
            (showRunsSince ? "p, 6dlu," : "") + "170px"); // rows //$NON-NLS-1$
    DefaultFormBuilder builder = new DefaultFormBuilder(layout);
    builder.setDefaultDialogBorder();// w ww.  j ava2  s.c  o m

    if (showRunsSince) {
        builder.append(Main.getRunSinceMessage());
        builder.nextLine(2);
    }
    builder.append(HelpDialog.makeDonatePanel(false));
    return builder.getPanel();
}

From source file:com.projity.dialog.FeatureNotAvailableDialog.java

License:Common Public License

public JComponent createContentPanel() {
    FormLayout layout = new FormLayout("400px", "100px");// rows,cols //$NON-NLS-1$
    DefaultFormBuilder builder = new DefaultFormBuilder(layout);
    builder.setDefaultDialogBorder();//from w  ww  .  j a  va  2  s .  co  m
    JTextArea textArea = new JTextArea(Messages.getString("Text.notAvailableWithJava15"), 4, 50);

    textArea.setLineWrap(true);
    textArea.setWrapStyleWord(true);
    textArea.setEditable(false);
    textArea.setOpaque(false);
    builder.append(textArea);

    Hyperlink link = new Hyperlink(Messages.getString("Text.javaUpgradeUrl"),
            Messages.getString("Text.javaUpgradeUrl"));
    JLabel linkLabel = link.createLinkLabel();

    builder.append(linkLabel);

    return builder.getPanel();
}

From source file:com.projity.dialog.FieldAliasDialog.java

License:Common Public License

/**
 * Builds the panel. Initializes and configures components first, then
 * creates a FormLayout, configures the layout, creates a builder, sets a
 * border, and finally adds the components.
 * //from   w  w w .  j a  v a2  s.c  o m
 * @return the built panel
 */

public JComponent createContentPanel() {
    // Separating the component initialization and configuration
    // from the layout code makes both parts easier to read.
    initControls();
    //TODO set minimum size
    FormLayout layout = new FormLayout("default, 3dlu, 120dlu:grow", // cols //$NON-NLS-1$
            "p, 3dlu,p,3dlu,p,3dlu,p"); // rows //$NON-NLS-1$

    // Create a builder that assists in adding components to the container.
    // Wrap the panel with a standardized border.
    DefaultFormBuilder builder = new DefaultFormBuilder(layout);
    builder.setDefaultDialogBorder();
    builder.append(Messages.getString("Field.name"), defaultName); //$NON-NLS-1$
    builder.nextLine(2);
    builder.append(Messages.getString("RenameDialog.CurrentName"), oldName); //$NON-NLS-1$
    builder.nextLine(2);
    builder.append(Messages.getString("RenameDialog.NewName"), newName); //$NON-NLS-1$
    return builder.getPanel();
}

From source file:com.projity.dialog.FieldDialog.java

License:Common Public License

protected JComponent createFieldsPanel(FieldComponentMap map, Collection fields) {
    if (fields == null || fields.size() == 0)
        return null;

    FormLayout layout = new FormLayout("p, 3dlu, fill:160dlu:grow", //$NON-NLS-1$
            StringUtils.chomp(StringUtils.repeat("p,3dlu,", fields.size()))); // repeats and gets rid of last comma //$NON-NLS-1$
    DefaultFormBuilder builder = new DefaultFormBuilder(layout);
    map.append(builder, fields);//from ww  w. j ava 2 s.  c o  m
    return builder.getPanel();
}

From source file:com.projity.dialog.FindDialog.java

License:Common Public License

/**
 * Builds the panel. Initializes and configures components first, then
 * creates a FormLayout, configures the layout, creates a builder, sets a
 * border, and finally adds the components.
 *
 * @return the built panel//  w  w  w.  ja  v  a  2 s .  c o  m
 */

public JComponent createContentPanel() {
    //      initControls();
    // Separating the component initialization and configuration
    // from the layout code makes both parts easier to read.
    //TODO set minimum size
    FormLayout layout = new FormLayout("default, 3dlu, default, 3dlu, default", // cols //$NON-NLS-1$
            "p, 3dlu, p"); // rows //$NON-NLS-1$

    // Create a builder that assists in adding components to the container.
    // Wrap the panel with a standardized border.
    DefaultFormBuilder builder = new DefaultFormBuilder(layout);
    builder.setDefaultDialogBorder();
    CellConstraints cc = new CellConstraints();

    builder.append(Messages.getString("LookupDialog.Find"), search); //$NON-NLS-1$
    builder.nextLine(2);
    builder.append(Messages.getString("Text.Field"), combo); //$NON-NLS-1$
    return builder.getPanel();
}

From source file:com.projity.dialog.HelpDialog.java

License:Common Public License

/**
 * Builds the panel. Initializes and configures components first, then
 * creates a FormLayout, configures the layout, creates a builder, sets a
 * border, and finally adds the components.
 * //from   w w  w  . j  a v  a  2 s .co  m
 * @return the built panel
 */

public JComponent createContentPanel() {
    // Separating the component initialization and configuration
    // from the layout code makes both parts easier to read.
    //TODO set minimum size
    FormLayout layout = new FormLayout("120px,180px,120px", // cols //$NON-NLS-1$

            "p, 6dlu,  p,6dlu,p,6dlu,p,6dlu,p,6dlu,p"); // rows //$NON-NLS-1$

    // Create a builder that assists in adding components to the container.
    // Wrap the panel with a standardized border.
    DefaultFormBuilder builder = new DefaultFormBuilder(layout);
    builder.setDefaultDialogBorder();
    CellConstraints cc = new CellConstraints();
    JLabel logo = new JLabel(IconManager.getIcon("logo.ProjectLibre"));
    logo.addMouseListener(new MouseAdapter() {
        public void mouseClicked(MouseEvent arg0) {
            BrowserControl.displayURL("http://www.projectlibre.com");//$NON-NLS-1$
        }
    });
    builder.nextColumn();
    builder.append(logo);
    builder.nextLine(2);
    builder.nextColumn();
    builder.append(link);
    //      builder.nextLine(2);
    //      builder.append(videos);
    if (Environment.isOpenProj()) {
        builder.nextLine(2);
        builder.nextColumn();
        builder.append(tipOfTheDay);
    }
    builder.nextLine(2);
    builder.nextColumn();
    builder.append(license);

    builder.nextLine(2);
    String version = VersionUtils.getVersion();
    builder.addLabel(Messages.getContextString("Text.ShortTitle") + " " + "Version "
            + (version == null ? "Unknown" : version), cc.xyw(1, 9, 3));
    builder.nextLine(2);
    builder.addLabel(Messages.getString("AboutDialog.copyright"), cc.xyw(1, 11, 3));

    if (false || Environment.isOpenProj()) { // removed donation link
        JPanel p = new JPanel();
        p.add(builder.getPanel());
        //      p.add(makeDonatePanel(false));
        return p;
    } else
        return builder.getPanel();
}