Search in sources :

Example 1 with ColumnLayoutData

use of org.eclipse.ui.forms.widgets.ColumnLayoutData 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 ColumnLayoutData

use of org.eclipse.ui.forms.widgets.ColumnLayoutData 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 ColumnLayoutData

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

the class MismatchDetailsPage method createConsequenceSection.

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

        public void expansionStateChanged(ExpansionEvent e) {
            overviewForm.reflow(true);
        }
    });
    sectionConsequence.setText("Consequence(s)");
    sectionConsequence.setDescription("What impacts this mismatch has.");
    Composite sectionConsequenceClient = toolkit.createComposite(sectionConsequence);
    ColumnLayout consequenceColumnLayout = new ColumnLayout();
    consequenceColumnLayout.maxNumColumns = 1;
    sectionConsequenceClient.setLayout(consequenceColumnLayout);
    Tree treeConsequence = toolkit.createTree(sectionConsequenceClient, SWT.NULL);
    treeConsequence.setLayout(new ColumnLayout());
    ColumnLayoutData treeLayoutData = new ColumnLayoutData(50, 123);
    treeConsequence.setLayoutData(treeLayoutData);
    toolkit.paintBordersFor(sectionConsequenceClient);
    sectionConsequence.setClient(sectionConsequenceClient);
    this.consequenceTreeViewer = new TreeViewer(treeConsequence);
    this.consequenceTreeViewer.setContentProvider(new ConsequenceContentProvider());
    this.consequenceTreeViewer.setLabelProvider(new ConsequenceLabelProvider());
}
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)

Aggregations

Composite (org.eclipse.swt.widgets.Composite)3 ExpansionAdapter (org.eclipse.ui.forms.events.ExpansionAdapter)3 ExpansionEvent (org.eclipse.ui.forms.events.ExpansionEvent)3 ColumnLayoutData (org.eclipse.ui.forms.widgets.ColumnLayoutData)3 Section (org.eclipse.ui.forms.widgets.Section)3 TreeViewer (org.eclipse.jface.viewers.TreeViewer)2 Tree (org.eclipse.swt.widgets.Tree)2 ColumnLayout (org.eclipse.ui.forms.widgets.ColumnLayout)2 GridData (org.eclipse.swt.layout.GridData)1 GridLayout (org.eclipse.swt.layout.GridLayout)1 Label (org.eclipse.swt.widgets.Label)1