use of org.eclipse.ui.forms.events.ExpansionEvent in project liferay-ide by liferay.
the class AbstractValidationSettingsPage method createTwistie.
protected ExpandableComposite createTwistie(Composite parent, String label, int nColumns) {
ExpandableComposite excomposite = new ExpandableComposite(parent, SWT.NONE, ExpandableComposite.TWISTIE | ExpandableComposite.CLIENT_INDENT);
excomposite.setText(label);
excomposite.setExpanded(false);
excomposite.setFont(JFaceResources.getFontRegistry().getBold(JFaceResources.DIALOG_FONT));
excomposite.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, false, nColumns, 1));
excomposite.addExpansionListener(new ExpansionAdapter() {
@Override
public void expansionStateChanged(ExpansionEvent e) {
expandedStateChanged((ExpandableComposite) e.getSource());
}
});
_fExpandables.add(excomposite);
_makeScrollableCompositeAware(excomposite);
return excomposite;
}
use of org.eclipse.ui.forms.events.ExpansionEvent 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);
}
}
use of org.eclipse.ui.forms.events.ExpansionEvent 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;
}
use of org.eclipse.ui.forms.events.ExpansionEvent 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;
}
use of org.eclipse.ui.forms.events.ExpansionEvent in project tmdm-studio-se by Talend.
the class ValidationPreferencePage method createExpandComposite.
private Composite createExpandComposite(final Composite parent, String title, boolean needExpanded) {
ExpandableComposite expComposite = new ExpandableComposite(parent, ExpandableComposite.TREE_NODE | ExpandableComposite.EXPANDED);
expComposite.setLayout(new GridLayout());
expComposite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
Composite composite = new Composite(expComposite, SWT.NONE);
GridLayout layout = new GridLayout();
layout.marginLeft = 10;
layout.marginRight = 10;
composite.setLayout(layout);
composite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
expComposite.setClient(composite);
expComposite.setText(title);
expComposite.setExpanded(needExpanded);
expComposite.addExpansionListener(new ExpansionAdapter() {
@Override
public void expansionStateChanged(ExpansionEvent e) {
parent.layout();
}
});
return composite;
}
Aggregations