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

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

Introduction

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

Prototype

public JLabel append(String textWithMnemonic) 

Source Link

Document

Adds a text label to the panel and proceeds to the next column.

Usage

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

License:Common Public License

public JComponent createPredecessorsPanel() {
    FieldComponentMap map = createMap();
    FormLayout layout = new FormLayout("p:grow", "p,3dlu,p,3dlu,fill:150dlu:grow"); //$NON-NLS-1$ //$NON-NLS-2$

    DefaultFormBuilder builder = new DefaultFormBuilder(layout);
    builder.setDefaultDialogBorder();//from  ww  w .j  a  v  a2  s .c  om
    CellConstraints cc = new CellConstraints();
    builder.add(createHeaderFieldsPanel(map), cc.xyw(builder.getColumn(), builder.getRow(), 1));
    builder.nextLine(2);
    builder.append(Messages.getString("Spreadsheet.Dependency.predecessors") + ":"); //$NON-NLS-1$ //$NON-NLS-2$
    builder.nextLine(2);
    builder.add(createPredecessorsSpreadsheet());
    JComponent pred = builder.getPanel();
    HelpUtil.addDocHelp(pred, "Linking");
    return pred;
}

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

License:Common Public License

public JComponent createSuccessorsPanel() {
    FieldComponentMap map = createMap();
    FormLayout layout = new FormLayout("p:grow", "p,3dlu,p,3dlu,fill:150dlu:grow"); //$NON-NLS-1$ //$NON-NLS-2$

    DefaultFormBuilder builder = new DefaultFormBuilder(layout);
    builder.setDefaultDialogBorder();/*from  w  ww.  j a v  a 2s  .c  o  m*/
    CellConstraints cc = new CellConstraints();
    builder.add(createHeaderFieldsPanel(map), cc.xyw(builder.getColumn(), builder.getRow(), 1));
    builder.nextLine(2);
    builder.append(Messages.getString("Spreadsheet.Dependency.successors") + ":"); //$NON-NLS-1$ //$NON-NLS-2$
    builder.nextLine(2);
    builder.add(createSuccessorsSpreadsheet());
    JComponent succ = builder.getPanel();
    HelpUtil.addDocHelp(succ, "Linking");
    return succ;
}

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

License:Common Public License

public JComponent createContentPanel() {
    FormLayout layout = new FormLayout("300px", "110px");// rows,cols //$NON-NLS-1$
    DefaultFormBuilder builder = new DefaultFormBuilder(layout);
    builder.setDefaultDialogBorder();/*www . jav  a2 s . c o  m*/
    String tip = Messages.getString("tip.3.description");
    tip = tip.replace(PROJITY_LINK, "<a href=\"" + PROJITY_LINK + "\">" + PROJITY_LINK + "</a>");
    JEditorPane link = new JEditorPane("text/html", "<html><b>" + tip + "</b></html>");
    link.setEditable(false);
    link.setBackground(getBackground());
    link.addHyperlinkListener(new HyperlinkListener() {
        public void hyperlinkUpdate(HyperlinkEvent e) {
            if (e.getEventType() == HyperlinkEvent.EventType.ACTIVATED)
                BrowserControl.displayURL(e.getURL().toExternalForm());
        }
    });

    builder.append(link);
    return builder.getPanel();
}

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

License:Common Public License

public JComponent createContentPanel() {

    initControls();//  www.jav  a  2s. c  o  m

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

    DefaultFormBuilder builder = new DefaultFormBuilder(layout);
    builder.setDefaultDialogBorder();
    CellConstraints cc = new CellConstraints();

    builder.append(update);
    builder.append(Messages.getString("UpdateProjectDialogBox.UpdateWorkAsCompleteThrough")); //$NON-NLS-1$
    builder.append(updateDateChooser);
    builder.nextLine(2);
    builder.nextColumn(2);
    builder.add(progress, cc.xyw(builder.getColumn(), builder.getRow(), 5));
    builder.nextLine(2);
    builder.nextColumn(2);
    builder.add(completeOrNotOnly, cc.xyw(builder.getColumn(), builder.getRow(), 5));
    builder.nextLine(2);
    builder.append(reschedule);
    builder.append(Messages.getString("UpdateProjectDialogBox.RescheduleCompletedWorkToStartAfter")); //$NON-NLS-1$
    builder.append(rescheduleDateChooser);
    builder.nextLine(8);
    builder.addSeparator(""); //$NON-NLS-1$
    builder.nextLine(2);
    builder.append(Messages.getString("UpdateProjectDialogBox.For")); //$NON-NLS-1$
    builder.nextLine(2);
    builder.nextColumn(2);
    builder.append(entireProject);
    builder.nextLine(2);
    builder.nextColumn(2);
    builder.append(selectedTask);

    return builder.getPanel();
}

From source file:com.projity.dialog.util.FieldComponentMap.java

License:Common Public License

public JComponent appendField(DefaultFormBuilder builder, String fieldId, int flag) {
    Field field = Configuration.getFieldFromId(fieldId);
    if (field == null)
        return null;
    JComponent component = getComponent(fieldId, flag);
    if (component instanceof JCheckBox) // checkboxes already have a label to the right
        builder.append(component);
    else//w ww  .  j a v  a 2 s  . c o m
        builder.append(getLabel(fieldId) + ":", component);
    String fieldDoc = field.getHelp();
    if (fieldDoc != null)
        HelpUtil.addDocHelp(component, fieldDoc);
    return component;
}

From source file:com.projity.dialog.WelcomeDialog.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.  ja  va 2s.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, default, 3dlu, default", // cols //$NON-NLS-1$
            "p, 8dlu, p, 3dlu, p, 3dlu, p, 3dlu"); // 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.setBorder(BorderFactory.createEmptyBorder(20, 20, 20, 20)); // use bigger border to fit title bar text
    builder.append(Messages.getString("WelcomeDialog.WhatWouldYouLikeToDo") + "      "); // adding spaces to widen dialog //$NON-NLS-1$ //$NON-NLS-2$
    builder.nextLine(2);
    builder.append(createProject);
    builder.nextLine(2);
    builder.append(openProject);
    if (Environment.isAdministrator()) {
        builder.nextLine(2);
        builder.append(manageResources);
    }
    requestFocusInWindow();
    return builder.getPanel();
}

From source file:com.projity.dialog.XbsDependencyDialog.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();/* w  ww  .j a v  a 2 s . 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"); // 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));

    return builder.getPanel();
}

From source file:com.projity.print.PageSetup.java

License:Common Public License

private JComponent createPrinterPanel() {
    FormLayout layout = new FormLayout("p", "p, 3dlu");
    DefaultFormBuilder builder = new DefaultFormBuilder(layout);
    builder.append(printers);
    return builder.getPanel();
}

From source file:com.projity.print.PageSetup.java

License:Common Public License

private JComponent createVerticalPanel() {
    FormLayout layout = new FormLayout("p",
            printSpreadSheet == null ? "p,3dlu,p,3dlu,p,3dlu,p,3dlu,p,3dlu,p,3dlu"
                    : "p,3dlu,p,3dlu,p,3dlu,p,3dlu,p,3dlu,p,3dlu,p,3dlu,p,3dlu");
    DefaultFormBuilder builder = new DefaultFormBuilder(layout);
    builder.setDefaultDialogBorder();/*from   w  w w. jav  a  2s . c  o  m*/
    //      builder.append(createFlowSettingsPanel());
    //      builder.nextLine(2);
    builder.append(createFlowPrinterPanel());
    builder.nextLine(2);
    builder.append(createFlowOrientationPanel());
    builder.nextLine(2);
    builder.append(createFlowPaperPanel());
    builder.nextLine(2);
    builder.append(createFlowMarginsPanel());
    builder.nextLine(2);
    if (printSpreadSheet != null) {
        builder.append(createFlowPartPanel());
        builder.nextLine(2);
    }
    builder.append(createFlowScalingPanel());
    builder.nextLine(2);
    builder.append(saveSettings);
    //      builder.nextLine(2);
    //      builder.append(saveWebPDFSettings);
    return builder.getPanel();
}

From source file:com.projity.print.PageSetup.java

License:Common Public License

private JComponent createFlowPrinterPanel() {
    FormLayout layout = new FormLayout("1dlu,p:grow,1dlu", "p, 3dlu");
    DefaultFormBuilder builder = new DefaultFormBuilder(layout);
    builder.nextColumn();/*w  w w  .  j a  v  a  2s.  c o  m*/
    builder.append(printers);
    JPanel panel = builder.getPanel();
    panel.setBorder(new TitledBorder(Messages.getString("PageSetupDialog.Printers")));
    return panel;
}