Package org.springframework.richclient.layout

Examples of org.springframework.richclient.layout.GridBagLayoutBuilder


  }

  protected abstract JComponent createContents();

  protected JComponent createControl() {
    GridBagLayoutBuilder builder = new GridBagLayoutBuilder();

    JComponent buttonPanel = null;
    if (createApplyAndDefaultButtons) {
      buttonPanel = createButtons();
    }

    JComponent contents = createContents();
    Assert.notNull(contents, "Contents cannot be null.");
    builder.append(contents, 1, 1, true, true);

    if (createApplyAndDefaultButtons) {
      builder.nextLine();
      builder.append(buttonPanel);
    }

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


    public SetupIntroWizardPage() {
        super("intro");
    }

    protected JComponent createControl() {
        GridBagLayoutBuilder builder = new GridBagLayoutBuilder();

        builder.setDefaultInsets(new Insets(10, 20, 0, 0));

        builder.append(createWelcomeToLabel(), 1, 1, true, false);
        builder.nextLine();
        builder.append(createTitleLabel(), 1, 1, true, false, new Insets(10, 20, 15, 0));

        builder.nextLine();
        builder.append(createDescriptionLabel(), 1, 1, true, false);

        builder.nextLine();
        builder.append(createSpacer(0, 0), 1, 1, true, true);

        JPanel control = builder.getPanel();
        control.setOpaque(false);
        return control;
    }
View Full Code Here

    };
    doNotAcceptCommand.setSelected(true);

    CommandGroup.createExclusiveCommandGroup(new ToggleCommand[] { acceptCommand, doNotAcceptCommand });

    GridBagLayoutBuilder formBuilder = new GridBagLayoutBuilder();
    formBuilder.append(new JScrollPane(licenseTextPane), 1, 1, true, true);
    formBuilder.nextLine();
    formBuilder.append(acceptCommand.createRadioButton());
    formBuilder.nextLine();
    formBuilder.append(doNotAcceptCommand.createRadioButton());
    return formBuilder.getPanel();
  }
View Full Code Here

    }

    public JPanel getPanel() {
        ComponentFactory cf = getComponentFactory();
        JLabel label = cf.createLabelFor(getMessage("annotationToolWindow.annotations.comboBox.label"), this.jcbAnnotations);
        GridBagLayoutBuilder builder = new GridBagLayoutBuilder();
        builder.setAutoSpanLastComponent(false);
        builder.setDefaultInsets(new Insets(5, 5, 5, 5));
        builder.appendLabel(label).append(this.jcbAnnotations, 1, 1, false, false).append(Box.createHorizontalStrut(10), 1, 1, true, false).append(jcbEnableHtml, 1, 1, false, false, new Insets(5, 5, 5, 5)).nextLine();
        builder.append(cf.createScrollPane(jetDocumentation, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED, JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED), 4, 1, true, true).nextLine();

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

     * holding this view.
     */
    @Override
    protected JComponent createControl() {
        createSchemaElementsChart();
        GridBagLayoutBuilder builder = new GridBagLayoutBuilder();

        final ComponentFactory cf = getComponentFactory();
        builder.append(cf.createTitleLabel("schemaInfoView.titleLabel"), 1, 1, true, false).nextLine();
        builder.append(cf.createLabel("schemaInfoView.schema.targetNamespace", new ValueModel[] { targetNamespace}), 1, 1, true, false).nextLine();

        builder.append(cpSchemaElements, 1, 1, true, true);
        return builder.getPanel();
    }
View Full Code Here

        final CommandGroup group = getWindowCommandManager().createCommandGroup("typeListCommandGroup", new Object[] { typeHierarchyCommand, typeInspectionCommand, "separator", GlobalCommandIds.PROPERTIES});
        final JPopupMenu popup = group.createPopupMenu();
        detailList.addMouseListener(new PopupMenuMouseListener(popup));

        // build master view
        final GridBagLayoutBuilder masterPanelBuilder = new GridBagLayoutBuilder();
        final ComponentFactory cf = getComponentFactory();
        masterPanelBuilder.append(cf.createLabel("sameNameDifferentTypesView.nameList.label", new ValueModel[] { numNames})).nextLine();
        masterPanelBuilder.append(cf.createScrollPane(masterList, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED, JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED), 1, 1, true, true);

        // build detail view
        final GridBagLayoutBuilder detailPanelBuilder = new GridBagLayoutBuilder();
        detailPanelBuilder.append(FilterToolbarFactory.createFilterToolBar(elementTypeConstraint), 1, 1, true, false).nextLine();
        detailPanelBuilder.append(cf.createLabel("sameNameDifferentTypesView.typeList.label", new ValueModel[] { numTypes})).nextLine();
        detailPanelBuilder.append(cf.createScrollPane(detailList, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED, JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED), 1, 1, true, true);

        final JSplitPane jsp = new JSplitPane(JSplitPane.VERTICAL_SPLIT);
        jsp.setDividerLocation(0.5f);
        jsp.setTopComponent(masterPanelBuilder.getPanel());
        jsp.setBottomComponent(detailPanelBuilder.getPanel());
        return jsp;
    }
View Full Code Here

        final JList detailList = masterDetailList.getDetailList();
        detailList.setCellRenderer(new SchemaElementsRenderer());
        masterList.setCellRenderer(new SimilarTypeRenderer());

        // build master view
        final GridBagLayoutBuilder typeListPanelBuilder = new GridBagLayoutBuilder();
        typeListPanelBuilder.append(cf.createLabel("similarTypesView.typeList.label", new ValueModel[] { numSimilarTypesSchema})).nextLine();
        typeListPanelBuilder.append(cf.createScrollPane(masterList, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED), 1, 1, true, true);

        final CommandGroup group = getWindowCommandManager().createCommandGroup("similarTypesCommandGroup", new Object[] { similarTypesTypeHierarchyCommand, similarTypesInspectionCommand, "separator", GlobalCommandIds.PROPERTIES});
        masterList.addMouseListener(new PopupMenuMouseListener(group.createPopupMenu()));

        masterList.addListSelectionListener(new ListSelectionListener() {

            @Override
            public void valueChanged(ListSelectionEvent evt) {
                Map<String, XSObject> parameters = new HashMap<String, XSObject>();
                final SimilarTypeListModelEntry similarTypeListModelEntry = (SimilarTypeListModelEntry) masterList.getSelectedValue();
                if (null == similarTypeListModelEntry) return;
                parameters.put(XsElementPropertiesExecutor.OBJECT, similarTypeListModelEntry.getType());
                xsElementPropertiesExecutor.execute(parameters);
            }
        });

        // build client view
        final GridBagLayoutBuilder similarTypesListPanelBuilder = new GridBagLayoutBuilder();
        similarTypesListPanelBuilder.append(cf.createLabel("similarTypesView.similarTypeList.label", new ValueModel[] { numSimilarTypes})).nextLine();
        similarTypesListPanelBuilder.append(cf.createScrollPane(detailList, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED), 1, 1, true, true);

        final CommandGroup detailListGroup = getWindowCommandManager().createCommandGroup("typeListCommandGroup", new Object[] { typesListTypeHierarchyCommand, typesListTypeInspectionCommand, "separator", GlobalCommandIds.PROPERTIES});
        detailList.addMouseListener(new PopupMenuMouseListener(detailListGroup.createPopupMenu()));

        detailList.addListSelectionListener(new ListSelectionListener() {

            @Override
            public void valueChanged(ListSelectionEvent evt) {
                Map<String, XSObject> parameters = new HashMap<String, XSObject>();
                parameters.put(XsElementPropertiesExecutor.OBJECT, (XSObject) detailList.getSelectedValue());
                xsElementPropertiesExecutor.execute(parameters);
            }
        });

        // build main component
        JSplitPane jspSimilarTypes = new JSplitPane(JSplitPane.VERTICAL_SPLIT);
        jspSimilarTypes.setDividerLocation(0.66f);
        jspSimilarTypes.setTopComponent(typeListPanelBuilder.getPanel());
        jspSimilarTypes.setBottomComponent(similarTypesListPanelBuilder.getPanel());

        JPanel jpSimilarTypes = cf.createPanel(new BorderLayout());
        jpSimilarTypes.add(jspSimilarTypes, BorderLayout.CENTER);
        jpSimilarTypes.add(FilterToolbarFactory.createFilterToolBar(elementTypeConstraint), BorderLayout.NORTH);
View Full Code Here

     * @see org.springframework.richclient.dialog.TitledApplicationDialog#createTitledDialogContentPane()
     */
    @Override
    protected JComponent createTitledDialogContentPane() {
        ComponentFactory cf = getComponentFactory();
        GridBagLayoutBuilder builder = new GridBagLayoutBuilder();

        builder.appendLabel(new JLabel(getMessage("runMultiple.analyzerSelectLabel")));
        builder.nextLine();

        for (Analyzer analyzer : getAvailableAnalyzers()) {
            JCheckBox jcb = cf.createCheckBox(analyzer.getLabelProvider().getCaption());
            jcb.addActionListener(new AnalyzerCheckBoxListener(this.selectedAnalyzers, analyzer));
            builder.append(jcb);
            builder.nextLine();
        }

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

    protected JComponent createControl() {
        createUnusedTypesList();
        createUsedTypesTree();

        final ComponentFactory cf = getComponentFactory();
        final GridBagLayoutBuilder builder = new GridBagLayoutBuilder();
        builder.setDefaultInsets(new Insets(2, 5, 2, 5));

        final JToolBar filterToolbar = FilterToolbarFactory.createFilterToolBar(new SchemaTypeConstraint[] { unusedTypesConstraint, usedTypesConstraint});
        builder.append(filterToolbar, 1, 1, true, false).nextLine();

        builder.appendLabel(cf.createLabel("typeUsageView.label.unusedTypes", new ValueModel[] { numUnusedTypes})).nextLine();

        builder.append(cf.createScrollPane(jlUnusedTypes, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED), 1, 1, 1, 1).nextLine();

        builder.appendSeparator();

        builder.appendLabel(cf.createLabel("typeUsageView.label.usedTypes", new ValueModel[] { numUsedTypes})).nextLine();

        builder.append(cf.createScrollPane(jtUsedTypes, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED), 1, 1, 1, 2);

        builder.setAutoSpanLastComponent(true);
        JPanel jpTypeUsage = builder.getPanel();

        return jpTypeUsage;
    }
View Full Code Here

        JTabbedPane jtb = cf.createTabbedPane();

        final TypeHierarchyPanel typeHierarchyPanel = new TypeHierarchyPanel();
        typeHierarchyPanel.setType(type);

        GridBagLayoutBuilder builder = new GridBagLayoutBuilder();

        final JTextField jtfLocalName = cf.createTextField();
        jtfLocalName.setText(type.getName());
        jtfLocalName.setEditable(false);

        final JTextField jtfNamespace = cf.createTextField();
        jtfNamespace.setText(type.getNamespace());
        jtfNamespace.setEditable(false);

        builder.append(new JLabel("Local name:")).append(jtfLocalName, 1, 1, true, false).nextLine();
        builder.append(new JLabel("Namespace:")).append(jtfNamespace, 1, 1, true, false).nextLine();
        builder.append(Box.createVerticalStrut(10), 2, 1, true, true);

        jtb.add("General", builder.getPanel());
        jtb.add("Type hierarchy", typeHierarchyPanel);
        jtb.add("Annotations", annotationPanel.getPanel());

        return jtb;
    }
View Full Code Here

TOP

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

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.