Package org.springframework.richclient.layout

Examples of org.springframework.richclient.layout.TableLayoutBuilder


        control.setPreferredSize(getLargestPageSize());
        pagePanel.add(control, page.getId());
    }

    protected JPanel createContentControl() {
        TableLayoutBuilder panelBuilder = new TableLayoutBuilder();
        String colSpec = "colSpec=" + getTreeControlWidth() + " rowSpec=fill:default:grow";
        panelBuilder.cell(new JScrollPane(pageTree), colSpec);
        panelBuilder.gapCol();
        panelBuilder.cell(pagePanel, "valign=top");
        return panelBuilder.getPanel();
    }
View Full Code Here


        iconLabel.setIcon(getIcon());

        JPanel panel = new JPanel();
        panel.setName("panel");
        panel.setBackground(getBackgroundColor());
        TableLayoutBuilder table = new TableLayoutBuilder(panel);
        table.row(FormFactory.LINE_GAP_ROWSPEC);
        table.gapCol();
        table.cell(titleLabel);
        table.gapCol();
        table.cell(iconLabel, "rowspan=2 colspec=pref");
        table.row(FormFactory.NARROW_LINE_GAP_ROWSPEC);
        table.cell(messagePane.getControl());
        table.row(FormFactory.NARROW_LINE_GAP_ROWSPEC);
        return table.getPanel();
    }
View Full Code Here

  public AbstractSelectionDialog(String title, Window parent) {
    super(title, parent);
  }

  protected JComponent createDialogContentPane() {
    TableLayoutBuilder builder = new TableLayoutBuilder();

    JComponent selectionComponent = createSelectionComponent();
    Assert.state(selectionComponent != null, "createSelectionComponent cannot return null");

    if (StringUtils.hasText(description)) {
      builder.cell(getComponentFactory().createLabelFor(description, selectionComponent));
      builder.relatedGapRow();
      builder.row();
    }

    builder.cell(selectionComponent);

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

        super(title, parent, filterList);
        this.filterList = filterList;
    }

    protected JComponent createSelectionComponent() {
        TableLayoutBuilder builder = new TableLayoutBuilder();

        JComponent filterComponent = createFilterComponent();
        builder.cell(filterComponent);
        builder.row();
        builder.relatedGapRow();
        builder.cell(super.createSelectionComponent());

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

    private JComboBox comboBox;
    private JCheckBox checkBox;
    private JTextField nestedField;

    public SimplePanel() {
        TableLayoutBuilder builder = new TableLayoutBuilder(this);

        stringField = new JTextField(10);
        stringField.setName("stringProperty");

        comboBox = new JComboBox(new String[] { "item 0", "item 1", "item 2" });
        comboBox.setName("comboProperty");

        checkBox = new JCheckBox("checkbox");
        checkBox.setName("booleanProperty");

        builder.cell(new JLabel("string"));
        builder.gapCol();
        builder.cell(stringField);
        builder.relatedGapRow();
        builder.cell(new JLabel("combo"));
        builder.gapCol();
        builder.cell(comboBox);
        builder.relatedGapRow();
        builder.cell(checkBox);
        builder.relatedGapRow();
       
        JPanel nestedPanel =new JPanel();
        nestedField = new JTextField("test");
        nestedField.setName("nestedField");
        nestedPanel.add(nestedField);
       
        builder.cell(nestedPanel);

        builder.getPanel();
    }
View Full Code Here

     * IMPORTANT: This code isn't a good example of how to write a view.
     * It's just here to prove how the exception handlers work.
     * Take a look at the application context to see how the exception handler(s) are configured.
     */
    protected JComponent createControl() {
        TableLayoutBuilder layoutBuilder = new TableLayoutBuilder();

        layoutBuilder.cell(new JLabel("This page demonstrates the exception handling."));
        layoutBuilder.row();
        layoutBuilder.cell(new JLabel("Push the buttons and see which exception handler gets choosen."));
        layoutBuilder.row();
        layoutBuilder.cell(new JLabel("That defines the log level and the dialog shown."));
        layoutBuilder.row();
        layoutBuilder.unrelatedGapRow();

        JButton badCredentials = new JButton(new AbstractAction("Login with bad credentials"){
            public void actionPerformed(ActionEvent e) {
                loginWithBadCredentials();
            }
        });
        layoutBuilder.cell(badCredentials);
        layoutBuilder.row();
        layoutBuilder.relatedGapRow();

        JButton accessDenied = new JButton(new AbstractAction("Do something you don't have access to"){
            public void actionPerformed(ActionEvent e) {
                denyAccess();
            }
        });
        layoutBuilder.cell(accessDenied);
        layoutBuilder.row();
        layoutBuilder.relatedGapRow();

        JButton invalidPerson = new JButton(new AbstractAction("Validate a person with a null name and age 1981"){
            public void actionPerformed(ActionEvent e) {
                validateInvalidPerson();
            }
        });
        layoutBuilder.cell(invalidPerson);
        layoutBuilder.row();
        layoutBuilder.relatedGapRow();

        JButton nullPointer = new JButton(new AbstractAction("Cause a NumberFormatException"){
            public void actionPerformed(ActionEvent e) {
                causeNumberFormatException();
            }
        });
        layoutBuilder.cell(nullPointer);
        layoutBuilder.row();
        layoutBuilder.relatedGapRow();

        JButton stackOverflow = new JButton(new AbstractAction("Cause a stack overflow error"){
            public void actionPerformed(ActionEvent e) {
                causeStackOverflow();
            }
        });
        layoutBuilder.cell(stackOverflow);
        layoutBuilder.row();

        JPanel panel = layoutBuilder.getPanel();
        panel.setBorder(GuiStandardUtils.createEvenlySpacedBorder(UIConstants.ONE_SPACE));
        return panel;
    }
View Full Code Here

        }
        return reporter;
    }

    protected JComponent createDialogContentPane() {
        TableLayoutBuilder layoutBuilder = new TableLayoutBuilder();

        if (this.inputField == null) {
            this.inputField = getComponentFactory().createTextField();
        }
        // work around for bug in JFormattedTextField text field for selectAll
        if (inputField instanceof JFormattedTextField) {
            SelectAllBugFixer selectAllBugFixer = new SelectAllBugFixer();
            inputField.addFocusListener(selectAllBugFixer);
        }

        layoutBuilder.cell(createInputLabel(), TableLayoutBuilder.DEFAULT_LABEL_ATTRIBUTES);
        layoutBuilder.labelGapCol();
        layoutBuilder.cell(inputField);

        layoutBuilder.unrelatedGapRow();
        layoutBuilder.cell(getMessagePane().getControl());

        layoutBuilder.relatedGapRow();
        layoutBuilder.separator("");
        return layoutBuilder.getPanel();
    }
View Full Code Here

     *
     * @return The form containing the added fields, components and labels in the defined layout. Not null
     */
    public TableLayoutBuilder getLayoutBuilder() {
        if (builder == null) {
            builder = new TableLayoutBuilder(getComponentFactory().createPanel());
        }
        return builder;
    }
View Full Code Here

        JComponent component = binding.getControl();
        final JLabel label = createLabelFor(binding.getProperty(), component);
        if (wrappedComponent == null) {
            wrappedComponent = component;
        }
        TableLayoutBuilder layoutBuilder = getLayoutBuilder();
        if (!layoutBuilder.hasGapToLeft()) {
            layoutBuilder.gapCol();
        }
        layoutBuilder.cell(label, labelAttributes);
        layoutBuilder.labelGapCol();
        layoutBuilder.cell(wrappedComponent, attributes);
        return new JComponent[] { label, component, wrappedComponent };
    }
View Full Code Here

  @Override
  protected void fillFilterPanel( @NotNull JPanel filterPanel, @NotNull ObjectTable<T> objectTable ) {
    Map<String, JTextField> filterFields = new HashMap<String, JTextField>();

    TableLayoutBuilder builder = new TableLayoutBuilder( filterPanel );

    for ( String filteredProperty : filteredProperties ) {
      //      builder.cell( getComponentFactory().createLabel( objectId + '.' + filteredProperty + KEY_SUFFIX_FILTER_LABEL ) );
      builder.cell( getComponentFactory().createLabel( createMessageKeys( filteredProperty ) ) );
      builder.labelGapCol();

      JTextField filterField = getComponentFactory().createTextField();
      //      filterField.setToolTipText( getMessage(filteredProperty, KEY_LABEL, KEY_FILTER) );

      builder.cell( filterField );
      builder.gapCol();
      filterFields.put( filteredProperty, filterField );
    }

    builder.getPanel();

    configureFiltering( objectTable, filterFields );
  }
View Full Code Here

TOP

Related Classes of org.springframework.richclient.layout.TableLayoutBuilder

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.