Search in sources :

Example 1 with ColumnLayout

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

use of org.eclipse.ui.forms.widgets.ColumnLayout in project linuxtools by eclipse.

the class RangeFilterWizardPage method createControl.

@Override
public void createControl(Composite parent) {
    super.createControl(parent);
    Composite comp = new Composite(parent, SWT.NULL);
    comp.setLayout(new FormLayout());
    FormData data1 = new FormData();
    data1.left = new FormAttachment(0, 0);
    data1.top = new FormAttachment(0, 0);
    data1.right = new FormAttachment(40, 0);
    data1.bottom = new FormAttachment(100, 0);
    Composite cmpFilterOpts = new Composite(comp, SWT.NONE);
    cmpFilterOpts.setLayoutData(data1);
    ColumnLayout colLayout = new ColumnLayout();
    colLayout.maxNumColumns = 1;
    cmpFilterOpts.setLayout(colLayout);
    // Column
    Label lblColumn = new Label(cmpFilterOpts, SWT.NONE);
    // $NON-NLS-1$
    lblColumn.setText(Localization.getString("RangeFilterWizardPage.Column"));
    cboColumn = new Combo(cmpFilterOpts, SWT.DROP_DOWN | SWT.READ_ONLY);
    cboColumn.addSelectionListener(selectionListener);
    for (int i = 0; i < wizard.series.length; i++) {
        cboColumn.add(wizard.series[i]);
    }
    // Spacer
    new Label(cmpFilterOpts, SWT.NONE);
    // Low
    Label lblLow = new Label(cmpFilterOpts, SWT.NONE);
    // $NON-NLS-1$
    lblLow.setText(Localization.getString("RangeFilterWizardPage.LowerBound"));
    txtLow = new Text(cmpFilterOpts, SWT.BORDER);
    txtLow.addModifyListener(modifyListener);
    txtLow.addKeyListener(numberKeyListener);
    // High
    Label lblHigh = new Label(cmpFilterOpts, SWT.NONE);
    // $NON-NLS-1$
    lblHigh.setText(Localization.getString("RangeFilterWizardPage.UpperBound"));
    txtHigh = new Text(cmpFilterOpts, SWT.BORDER);
    txtHigh.addModifyListener(modifyListener);
    txtHigh.addKeyListener(numberKeyListener);
    // Spacer
    new Label(cmpFilterOpts, SWT.NONE);
    // Style
    radInside = new Button(cmpFilterOpts, SWT.RADIO);
    // $NON-NLS-1$
    radInside.setText(Localization.getString("RangeFilterWizardPage.InsideBounds"));
    radInside.addSelectionListener(selectionListener);
    radInside.setSelection(true);
    radOutside = new Button(cmpFilterOpts, SWT.RADIO);
    // $NON-NLS-1$
    radOutside.setText(Localization.getString("RangeFilterWizardPage.OutsideBounds"));
    radOutside.addSelectionListener(selectionListener);
    chkInclusive = new Button(cmpFilterOpts, SWT.CHECK);
    // $NON-NLS-1$
    chkInclusive.setText(Localization.getString("RangeFilterWizardPage.Inclusive"));
    chkInclusive.addSelectionListener(selectionListener);
    // Spacer
    new Label(cmpFilterOpts, SWT.NONE);
    cboColumn.select(0);
    createFilter();
    setControl(comp);
}
Also used : FormLayout(org.eclipse.swt.layout.FormLayout) FormData(org.eclipse.swt.layout.FormData) Composite(org.eclipse.swt.widgets.Composite) Button(org.eclipse.swt.widgets.Button) ColumnLayout(org.eclipse.ui.forms.widgets.ColumnLayout) Label(org.eclipse.swt.widgets.Label) Combo(org.eclipse.swt.widgets.Combo) Text(org.eclipse.swt.widgets.Text) FormAttachment(org.eclipse.swt.layout.FormAttachment)

Example 3 with ColumnLayout

use of org.eclipse.ui.forms.widgets.ColumnLayout in project linuxtools by eclipse.

the class SortFilterWizardPage method createControl.

@Override
public void createControl(Composite parent) {
    super.createControl(parent);
    Composite comp = new Composite(parent, SWT.NULL);
    comp.setLayout(new FormLayout());
    FormData data1 = new FormData();
    data1.left = new FormAttachment(0, 0);
    data1.top = new FormAttachment(0, 0);
    data1.right = new FormAttachment(40, 0);
    data1.bottom = new FormAttachment(100, 0);
    Composite cmpFilterOpts = new Composite(comp, SWT.NONE);
    cmpFilterOpts.setLayoutData(data1);
    ColumnLayout colLayout = new ColumnLayout();
    colLayout.maxNumColumns = 1;
    cmpFilterOpts.setLayout(colLayout);
    // Column
    Label lblColumn = new Label(cmpFilterOpts, SWT.NONE);
    // $NON-NLS-1$
    lblColumn.setText(Localization.getString("SortFilterWizardPage.Column"));
    cboColumn = new Combo(cmpFilterOpts, SWT.DROP_DOWN | SWT.READ_ONLY);
    cboColumn.addSelectionListener(selectionListener);
    for (int i = 0; i < wizard.series.length; i++) {
        cboColumn.add(wizard.series[i]);
    }
    // Spacer
    new Label(cmpFilterOpts, SWT.NONE);
    // Style
    radAscending = new Button(cmpFilterOpts, SWT.RADIO);
    // $NON-NLS-1$
    radAscending.setText(Localization.getString("SortFilterWizardPage.Ascending"));
    radAscending.addSelectionListener(selectionListener);
    radAscending.setSelection(true);
    radDescending = new Button(cmpFilterOpts, SWT.RADIO);
    // $NON-NLS-1$
    radDescending.setText(Localization.getString("SortFilterWizardPage.Descending"));
    radDescending.addSelectionListener(selectionListener);
    cboColumn.select(0);
    createFilter();
    setControl(comp);
}
Also used : FormLayout(org.eclipse.swt.layout.FormLayout) FormData(org.eclipse.swt.layout.FormData) Composite(org.eclipse.swt.widgets.Composite) Button(org.eclipse.swt.widgets.Button) ColumnLayout(org.eclipse.ui.forms.widgets.ColumnLayout) Label(org.eclipse.swt.widgets.Label) Combo(org.eclipse.swt.widgets.Combo) FormAttachment(org.eclipse.swt.layout.FormAttachment)

Example 4 with ColumnLayout

use of org.eclipse.ui.forms.widgets.ColumnLayout in project jbosstools-hibernate by jbosstools.

the class RevEngOverviewPage method createFormContent.

public void createFormContent(IManagedForm parent) {
    ScrolledForm form = parent.getForm();
    ColumnLayout layout = new ColumnLayout();
    layout.maxNumColumns = 2;
    form.getBody().setLayout(layout);
    createConsoleConfigName();
    createContentsSection();
    getManagedForm().setInput(reditor.getReverseEngineeringDefinition());
}
Also used : ScrolledForm(org.eclipse.ui.forms.widgets.ScrolledForm) ColumnLayout(org.eclipse.ui.forms.widgets.ColumnLayout)

Example 5 with ColumnLayout

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

ColumnLayout (org.eclipse.ui.forms.widgets.ColumnLayout)9 Composite (org.eclipse.swt.widgets.Composite)7 FormAttachment (org.eclipse.swt.layout.FormAttachment)5 FormData (org.eclipse.swt.layout.FormData)5 FormLayout (org.eclipse.swt.layout.FormLayout)5 Button (org.eclipse.swt.widgets.Button)5 Label (org.eclipse.swt.widgets.Label)5 Combo (org.eclipse.swt.widgets.Combo)4 TreeViewer (org.eclipse.jface.viewers.TreeViewer)2 Text (org.eclipse.swt.widgets.Text)2 Tree (org.eclipse.swt.widgets.Tree)2 ExpansionAdapter (org.eclipse.ui.forms.events.ExpansionAdapter)2 ExpansionEvent (org.eclipse.ui.forms.events.ExpansionEvent)2 ColumnLayoutData (org.eclipse.ui.forms.widgets.ColumnLayoutData)2 Section (org.eclipse.ui.forms.widgets.Section)2 ScrolledForm (org.eclipse.ui.forms.widgets.ScrolledForm)1