Search in sources :

Example 36 with TableWrapData

use of org.eclipse.ui.forms.widgets.TableWrapData in project tmdm-studio-se by Talend.

the class AMainPageV2 method getNewSection.

protected Section getNewSection(String title, int style) {
    // create the FormPart
    SectionPart newSectionPart = new SectionPart(this.getManagedForm().getForm().getBody(), this.getManagedForm().getToolkit(), style);
    this.getManagedForm().addPart(newSectionPart);
    // Layout the components
    Section newSection = newSectionPart.getSection();
    if (title != null) {
        newSection.setText(title);
    }
    newSection.setLayoutData(new TableWrapData(TableWrapData.FILL_GRAB));
    newSection.addExpansionListener(new ExpansionAdapter() {

        @Override
        public void expansionStateChanged(ExpansionEvent e) {
            AMainPageV2.this.getManagedForm().getForm().reflow(true);
        }
    });
    newSection.setLayout(new GridLayout(1, false));
    // this.getManagedForm().getToolkit().createCompositeSeparator(newSection);
    // in case someone calls getClient directly
    newSection.setClient(getNewSectionComposite(newSection));
    return newSection;
}
Also used : TableWrapData(org.eclipse.ui.forms.widgets.TableWrapData) GridLayout(org.eclipse.swt.layout.GridLayout) SectionPart(org.eclipse.ui.forms.SectionPart) ExpansionAdapter(org.eclipse.ui.forms.events.ExpansionAdapter) Section(org.eclipse.ui.forms.widgets.Section) ExpansionEvent(org.eclipse.ui.forms.events.ExpansionEvent)

Example 37 with TableWrapData

use of org.eclipse.ui.forms.widgets.TableWrapData in project tmdm-studio-se by Talend.

the class AMainPage method createFormContent.

@Override
protected void createFormContent(IManagedForm managedForm) {
    super.createFormContent(managedForm);
    try {
        // managedForm.getToolkit();
        FormToolkit toolkit = WidgetFactory.getWidgetFactory();
        final ScrolledForm form = managedForm.getForm();
        TableWrapLayout formLayout = new TableWrapLayout();
        form.getBody().setLayout(formLayout);
        formLayout.numColumns = 1;
        // create the FormPart
        firstSectionPart = new SectionPart(form.getBody(), toolkit, Section.DESCRIPTION | ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED | ExpandableComposite.TITLE_BAR);
        managedForm.addPart(firstSectionPart);
        // Layout the components
        Section firstSection = firstSectionPart.getSection();
        firstSection.setText(Messages.AMainPage_Characteristics);
        firstSection.setLayoutData(new TableWrapData(TableWrapData.FILL_GRAB));
        firstSection.addExpansionListener(new ExpansionAdapter() {

            @Override
            public void expansionStateChanged(ExpansionEvent e) {
                form.reflow(true);
            }
        });
        firstSection.setDescription(Messages.AMainPage_MainCharacteristics);
        firstSection.setLayout(new GridLayout(1, false));
        // toolkit.createCompositeSeparator(firstSection);
        Composite charComposite = toolkit.createComposite(firstSection);
        charComposite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
        GridLayout charLayout = new GridLayout(2, false);
        charComposite.setLayout(charLayout);
        firstSection.setClient(charComposite);
        createCharacteristicsContent(toolkit, charComposite);
        // adapt body add mouse/focus listener for child
        // WidgetFactory factory=WidgetFactory.getWidgetFactory();
        toolkit.adapt(form.getBody());
        initReadOnly(form);
    } catch (Exception e) {
        log.error(e.getMessage(), e);
    }
}
Also used : FormToolkit(org.eclipse.ui.forms.widgets.FormToolkit) Composite(org.eclipse.swt.widgets.Composite) ExpandableComposite(org.eclipse.ui.forms.widgets.ExpandableComposite) ExpansionAdapter(org.eclipse.ui.forms.events.ExpansionAdapter) Section(org.eclipse.ui.forms.widgets.Section) XtentisException(com.amalto.workbench.utils.XtentisException) TableWrapData(org.eclipse.ui.forms.widgets.TableWrapData) GridLayout(org.eclipse.swt.layout.GridLayout) SectionPart(org.eclipse.ui.forms.SectionPart) TableWrapLayout(org.eclipse.ui.forms.widgets.TableWrapLayout) ScrolledForm(org.eclipse.ui.forms.widgets.ScrolledForm) GridData(org.eclipse.swt.layout.GridData) ExpansionEvent(org.eclipse.ui.forms.events.ExpansionEvent)

Example 38 with TableWrapData

use of org.eclipse.ui.forms.widgets.TableWrapData in project tmdm-studio-se by Talend.

the class AMainPage method getNewSection.

protected Section getNewSection(String title, int style) {
    // create the FormPart
    SectionPart newSectionPart = new SectionPart(this.getManagedForm().getForm().getBody(), this.getManagedForm().getToolkit(), style);
    this.getManagedForm().addPart(newSectionPart);
    // Layout the components
    Section newSection = newSectionPart.getSection();
    if (title != null) {
        newSection.setText(title);
    }
    newSection.setLayoutData(new TableWrapData(TableWrapData.FILL_GRAB));
    newSection.addExpansionListener(new ExpansionAdapter() {

        @Override
        public void expansionStateChanged(ExpansionEvent e) {
            AMainPage.this.getManagedForm().getForm().reflow(true);
        }
    });
    newSection.setLayout(new GridLayout(1, false));
    // this.getManagedForm().getToolkit().createCompositeSeparator(newSection);
    // in case someone calls getClient directly
    newSection.setClient(getNewSectionComposite(newSection));
    return newSection;
}
Also used : TableWrapData(org.eclipse.ui.forms.widgets.TableWrapData) GridLayout(org.eclipse.swt.layout.GridLayout) SectionPart(org.eclipse.ui.forms.SectionPart) ExpansionAdapter(org.eclipse.ui.forms.events.ExpansionAdapter) Section(org.eclipse.ui.forms.widgets.Section) ExpansionEvent(org.eclipse.ui.forms.events.ExpansionEvent)

Aggregations

TableWrapData (org.eclipse.ui.forms.widgets.TableWrapData)38 GridLayout (org.eclipse.swt.layout.GridLayout)32 Composite (org.eclipse.swt.widgets.Composite)29 Section (org.eclipse.ui.forms.widgets.Section)29 GridData (org.eclipse.swt.layout.GridData)25 HyperlinkEvent (org.eclipse.ui.forms.events.HyperlinkEvent)20 HyperlinkAdapter (org.eclipse.ui.forms.events.HyperlinkAdapter)19 ImageHyperlink (org.eclipse.ui.forms.widgets.ImageHyperlink)16 ArrayContentProvider (org.eclipse.jface.viewers.ArrayContentProvider)14 TableViewer (org.eclipse.jface.viewers.TableViewer)14 TableWrapLayout (org.eclipse.ui.forms.widgets.TableWrapLayout)12 ExpandableComposite (org.eclipse.ui.forms.widgets.ExpandableComposite)5 FormText (org.eclipse.ui.forms.widgets.FormText)5 FormToolkit (org.eclipse.ui.forms.widgets.FormToolkit)5 ILabelProvider (org.eclipse.jface.viewers.ILabelProvider)3 SectionPart (org.eclipse.ui.forms.SectionPart)3 ExpansionAdapter (org.eclipse.ui.forms.events.ExpansionAdapter)3 ExpansionEvent (org.eclipse.ui.forms.events.ExpansionEvent)3 SyndEntry (com.sun.syndication.feed.synd.SyndEntry)2 Date (java.util.Date)2