Search in sources :

Example 1 with Section

use of org.eclipse.ui.forms.widgets.Section in project hale by halestudio.

the class MismatchDetailsPage method createMismatchSection.

@SuppressWarnings("unused")
private void createMismatchSection(Composite parent) {
    // create "Mismatch" Section
    Section sectionMismatch = toolkit.createSection(parent, Section.DESCRIPTION | Section.TITLE_BAR | Section.TWISTIE | Section.EXPANDED);
    ColumnLayoutData cd = new ColumnLayoutData();
    sectionMismatch.setLayoutData(cd);
    sectionMismatch.addExpansionListener(new ExpansionAdapter() {

        public void expansionStateChanged(ExpansionEvent e) {
            overviewForm.reflow(true);
        }
    });
    sectionMismatch.setText("Mismatch");
    sectionMismatch.setDescription("General information on this mismatch.");
    Composite sectionMismatchClient = toolkit.createComposite(sectionMismatch);
    sectionMismatchClient.setLayout(new GridLayout(2, false));
    Label labelType = toolkit.createLabel(sectionMismatchClient, "Type:");
    this.textType = toolkit.createText(sectionMismatchClient, "");
    this.textType.setLayoutData(new GridData(SWT.FILL, SWT.BEGINNING, true, false));
    this.textType.setEditable(false);
    Label labelProvenance = toolkit.createLabel(sectionMismatchClient, "Provenance:");
    this.textProvenance = toolkit.createText(sectionMismatchClient, "");
    this.textProvenance.setLayoutData(new GridData(SWT.FILL, SWT.BEGINNING, true, false));
    this.textProvenance.setEditable(false);
    Label labelStatus = toolkit.createLabel(sectionMismatchClient, "Status:");
    this.textStatus = toolkit.createText(sectionMismatchClient, "");
    this.textStatus.setLayoutData(new GridData(SWT.FILL, SWT.BEGINNING, true, false));
    Label labelComment = toolkit.createLabel(sectionMismatchClient, "Comments:");
    GridData gd = new GridData();
    gd.horizontalSpan = 2;
    labelComment.setLayoutData(gd);
    this.textComment = toolkit.createText(sectionMismatchClient, "", SWT.MULTI | SWT.WRAP | SWT.V_SCROLL);
    gd = new GridData();
    gd.horizontalSpan = 2;
    gd.grabExcessVerticalSpace = true;
    gd.grabExcessHorizontalSpace = true;
    gd.horizontalAlignment = SWT.FILL;
    gd.verticalAlignment = SWT.FILL;
    gd.heightHint = 40;
    textComment.setLayoutData(gd);
    toolkit.paintBordersFor(sectionMismatchClient);
    sectionMismatch.setClient(sectionMismatchClient);
}
Also used : GridLayout(org.eclipse.swt.layout.GridLayout) Composite(org.eclipse.swt.widgets.Composite) ColumnLayoutData(org.eclipse.ui.forms.widgets.ColumnLayoutData) Label(org.eclipse.swt.widgets.Label) GridData(org.eclipse.swt.layout.GridData) ExpansionAdapter(org.eclipse.ui.forms.events.ExpansionAdapter) Section(org.eclipse.ui.forms.widgets.Section) ExpansionEvent(org.eclipse.ui.forms.events.ExpansionEvent)

Example 2 with Section

use of org.eclipse.ui.forms.widgets.Section in project hale by halestudio.

the class MismatchDetailsPage method createReasonSection.

private void createReasonSection(Composite parent) {
    // create "Reason" Section
    Section sectionReason = toolkit.createSection(parent, Section.DESCRIPTION | Section.TITLE_BAR | Section.TWISTIE | Section.EXPANDED);
    ColumnLayoutData cd = new ColumnLayoutData();
    sectionReason.setLayoutData(cd);
    sectionReason.addExpansionListener(new ExpansionAdapter() {

        public void expansionStateChanged(ExpansionEvent e) {
            overviewForm.reflow(true);
        }
    });
    sectionReason.setText("Reason");
    sectionReason.setDescription("Why this mismatch occurs.");
    Composite sectionReasonClient = toolkit.createComposite(sectionReason);
    ColumnLayout reasonColumnLayout = new ColumnLayout();
    reasonColumnLayout.maxNumColumns = 1;
    sectionReasonClient.setLayout(reasonColumnLayout);
    Tree treeReason = toolkit.createTree(sectionReasonClient, SWT.NULL);
    treeReason.setLayout(new ColumnLayout());
    ColumnLayoutData treeLayoutData = new ColumnLayoutData(50, 123);
    treeReason.setLayoutData(treeLayoutData);
    toolkit.paintBordersFor(sectionReasonClient);
    sectionReason.setClient(sectionReasonClient);
    this.reasonTreeViewer = new TreeViewer(treeReason);
    this.reasonTreeViewer.setContentProvider(new ReasonContentProvider());
    this.reasonTreeViewer.setLabelProvider(new ReasonLabelProvider());
}
Also used : Composite(org.eclipse.swt.widgets.Composite) TreeViewer(org.eclipse.jface.viewers.TreeViewer) ColumnLayout(org.eclipse.ui.forms.widgets.ColumnLayout) ColumnLayoutData(org.eclipse.ui.forms.widgets.ColumnLayoutData) Tree(org.eclipse.swt.widgets.Tree) ExpansionAdapter(org.eclipse.ui.forms.events.ExpansionAdapter) Section(org.eclipse.ui.forms.widgets.Section) ExpansionEvent(org.eclipse.ui.forms.events.ExpansionEvent)

Example 3 with Section

use of org.eclipse.ui.forms.widgets.Section in project hale by halestudio.

the class MismatchPropertiesBlock method createMasterPart.

/* (non-Javadoc)
	 * @see org.eclipse.ui.forms.MasterDetailsBlock#createMasterPart(org.eclipse.ui.forms.IManagedForm, org.eclipse.swt.widgets.Composite)
	 */
@Override
protected void createMasterPart(final IManagedForm managedForm, Composite parent) {
    FormToolkit toolkit = managedForm.getToolkit();
    Section section = toolkit.createSection(parent, Section.DESCRIPTION | Section.TITLE_BAR);
    // $NON-NLS-1$
    section.setText("Mismatches");
    section.setDescription(// $NON-NLS-1$
    "Select the Mismatch or one of it's children to view and edit it.");
    section.marginWidth = 10;
    section.marginHeight = 5;
    Composite client = toolkit.createComposite(section, SWT.WRAP);
    GridLayout layout = new GridLayout();
    layout.numColumns = 2;
    layout.marginWidth = 2;
    layout.marginHeight = 2;
    client.setLayout(layout);
    Tree tree = toolkit.createTree(client, SWT.NULL);
    GridData gd = new GridData(GridData.FILL_BOTH);
    gd.heightHint = 20;
    gd.widthHint = 250;
    tree.setLayoutData(gd);
    toolkit.paintBordersFor(client);
    section.setClient(client);
    final SectionPart spart = new SectionPart(section);
    managedForm.addPart(spart);
    TreeViewer mismatchTreeViewer = new TreeViewer(tree);
    mismatchTreeViewer.addSelectionChangedListener(new ISelectionChangedListener() {

        @Override
        public void selectionChanged(SelectionChangedEvent event) {
            managedForm.fireSelectionChanged(spart, event.getSelection());
        }
    });
    mismatchTreeViewer.setContentProvider(new MismatchTreeContentProvider());
    mismatchTreeViewer.setLabelProvider(new MismatchTreeLabelProvider());
    mismatchTreeViewer.setInput(getDummyCell());
}
Also used : FormToolkit(org.eclipse.ui.forms.widgets.FormToolkit) Composite(org.eclipse.swt.widgets.Composite) TreeViewer(org.eclipse.jface.viewers.TreeViewer) ISelectionChangedListener(org.eclipse.jface.viewers.ISelectionChangedListener) SelectionChangedEvent(org.eclipse.jface.viewers.SelectionChangedEvent) Section(org.eclipse.ui.forms.widgets.Section) GridLayout(org.eclipse.swt.layout.GridLayout) SectionPart(org.eclipse.ui.forms.SectionPart) GridData(org.eclipse.swt.layout.GridData) Tree(org.eclipse.swt.widgets.Tree)

Example 4 with Section

use of org.eclipse.ui.forms.widgets.Section in project sling by apache.

the class ConnectionEditorSection method createSection.

@Override
public void createSection(Composite parent) {
    super.createSection(parent);
    FormToolkit toolkit = getFormToolkit(parent.getDisplay());
    Section section = toolkit.createSection(parent, ExpandableComposite.EXPANDED | ExpandableComposite.TITLE_BAR | Section.DESCRIPTION | ExpandableComposite.FOCUS_TITLE);
    section.setText("Connection");
    section.setDescription("Connection details for this server");
    section.setLayoutData(new GridData(GridData.FILL_HORIZONTAL | GridData.VERTICAL_ALIGN_FILL));
    // ports
    Composite composite = toolkit.createComposite(section);
    // layout similar to ServerPropertiesEditorSection
    GridLayout layout = new GridLayout();
    layout.numColumns = 2;
    layout.marginHeight = 5;
    layout.marginWidth = 10;
    layout.verticalSpacing = 5;
    layout.horizontalSpacing = 15;
    composite.setLayout(layout);
    composite.setLayoutData(new GridData(SWT.FILL, SWT.NONE, true, false));
    toolkit.paintBordersFor(composite);
    section.setClient(composite);
    createLabel(toolkit, composite, "Port:");
    portText = createText(toolkit, composite, SWT.SINGLE);
    createLabel(toolkit, composite, "Debug Port:");
    debugPortText = createText(toolkit, composite, SWT.SINGLE);
    createLabel(toolkit, composite, "Context path:");
    contextPathText = createText(toolkit, composite, SWT.SINGLE);
    // TODO wrong parent
    Label separator = toolkit.createSeparator(parent, SWT.HORIZONTAL);
    GridData data = new GridData(GridData.FILL_HORIZONTAL);
    data.horizontalSpan = 2;
    separator.setLayoutData(data);
    createLabel(toolkit, composite, "Username:");
    usernameText = createText(toolkit, composite, SWT.SINGLE);
    createLabel(toolkit, composite, "Password:");
    passwordText = createText(toolkit, composite, SWT.PASSWORD);
    initialize();
}
Also used : GridLayout(org.eclipse.swt.layout.GridLayout) FormToolkit(org.eclipse.ui.forms.widgets.FormToolkit) Composite(org.eclipse.swt.widgets.Composite) ExpandableComposite(org.eclipse.ui.forms.widgets.ExpandableComposite) GridData(org.eclipse.swt.layout.GridData) Label(org.eclipse.swt.widgets.Label) ServerEditorSection(org.eclipse.wst.server.ui.editor.ServerEditorSection) Section(org.eclipse.ui.forms.widgets.Section)

Example 5 with Section

use of org.eclipse.ui.forms.widgets.Section in project sling by apache.

the class DebugEditorSection method createSection.

@Override
public void createSection(Composite parent) {
    super.createSection(parent);
    FormToolkit toolkit = getFormToolkit(parent.getDisplay());
    Section section = toolkit.createSection(parent, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED | ExpandableComposite.TITLE_BAR | Section.DESCRIPTION | ExpandableComposite.FOCUS_TITLE);
    section.setText("Debug");
    section.setDescription("Resolving sources when connecting in debug mode ensure that you have up-to-date source attachments which reflect the " + "bundles running in the remote instance. However, initial resolve can be slow.");
    section.setLayoutData(new GridData(GridData.FILL_HORIZONTAL | GridData.VERTICAL_ALIGN_FILL));
    // ports
    Composite composite = toolkit.createComposite(section);
    GridLayout layout = new GridLayout();
    layout.numColumns = 2;
    layout.marginHeight = 8;
    layout.marginWidth = 8;
    composite.setLayout(layout);
    GridData gridData = new GridData(GridData.VERTICAL_ALIGN_FILL | GridData.FILL_HORIZONTAL);
    composite.setLayoutData(gridData);
    toolkit.paintBordersFor(composite);
    section.setClient(composite);
    resolveSourcesButton = toolkit.createButton(composite, "Resolve sources when connecting", SWT.CHECK);
    GridData data = new GridData(SWT.FILL, SWT.FILL, true, false, 2, 1);
    resolveSourcesButton.setLayoutData(data);
    actionArea = toolkit.createComposite(composite);
    RowLayout actionAreaLayout = new RowLayout();
    actionAreaLayout.center = true;
    actionArea.setLayout(actionAreaLayout);
    initialize();
}
Also used : GridLayout(org.eclipse.swt.layout.GridLayout) FormToolkit(org.eclipse.ui.forms.widgets.FormToolkit) Composite(org.eclipse.swt.widgets.Composite) ExpandableComposite(org.eclipse.ui.forms.widgets.ExpandableComposite) RowLayout(org.eclipse.swt.layout.RowLayout) GridData(org.eclipse.swt.layout.GridData) ServerEditorSection(org.eclipse.wst.server.ui.editor.ServerEditorSection) Section(org.eclipse.ui.forms.widgets.Section)

Aggregations

Section (org.eclipse.ui.forms.widgets.Section)260 Composite (org.eclipse.swt.widgets.Composite)229 GridLayout (org.eclipse.swt.layout.GridLayout)216 GridData (org.eclipse.swt.layout.GridData)215 ISection (org.eclipse.ui.views.properties.tabbed.ISection)103 ExpandableComposite (org.eclipse.ui.forms.widgets.ExpandableComposite)70 TableViewer (org.eclipse.jface.viewers.TableViewer)33 FormToolkit (org.eclipse.ui.forms.widgets.FormToolkit)32 ExpansionEvent (org.eclipse.ui.forms.events.ExpansionEvent)30 TableWrapData (org.eclipse.ui.forms.widgets.TableWrapData)29 ExpansionAdapter (org.eclipse.ui.forms.events.ExpansionAdapter)28 SelectionEvent (org.eclipse.swt.events.SelectionEvent)25 SelectionAdapter (org.eclipse.swt.events.SelectionAdapter)19 Group (org.eclipse.swt.widgets.Group)19 EJFrameworkExtensionProperties (org.entirej.framework.core.properties.definitions.interfaces.EJFrameworkExtensionProperties)19 ISelectionChangedListener (org.eclipse.jface.viewers.ISelectionChangedListener)17 SelectionChangedEvent (org.eclipse.jface.viewers.SelectionChangedEvent)17 HyperlinkEvent (org.eclipse.ui.forms.events.HyperlinkEvent)17 FillLayout (org.eclipse.swt.layout.FillLayout)16 HyperlinkAdapter (org.eclipse.ui.forms.events.HyperlinkAdapter)16