use of org.eclipse.ui.forms.events.ExpansionEvent in project eclipse-integration-commons by spring-projects.
the class ExpandableSection method createContents.
@Override
public void createContents(final Composite page) {
final ExpandableComposite comp = new ExpandableComposite(page, SWT.NONE);
GridDataFactory.fillDefaults().grab(true, false).applyTo(comp);
comp.setText(title);
comp.setLayout(new FillLayout());
comp.addExpansionListener(new IExpansionListener() {
public void expansionStateChanging(ExpansionEvent e) {
}
@Override
public void expansionStateChanged(ExpansionEvent e) {
expansionState.setValue(comp.isExpanded());
reflow(owner, comp);
}
});
expansionState.addListener(new ValueListener<Boolean>() {
public void gotValue(LiveExpression<Boolean> exp, Boolean value) {
if (value != null && comp != null && !comp.isDisposed()) {
boolean newState = value;
boolean currentState = comp.isExpanded();
if (currentState != newState) {
comp.setExpanded(newState);
reflow(owner, comp);
}
}
}
});
visibleState.addListener(new ValueListener<Boolean>() {
@Override
public void gotValue(LiveExpression<Boolean> exp, Boolean value) {
if (value != null && comp != null && !comp.isDisposed()) {
boolean newState = value;
comp.setVisible(newState);
GridData data = (GridData) comp.getLayoutData();
data.exclude = !newState;
reflow(owner, comp);
}
}
});
Composite client = new Composite(comp, SWT.NONE);
client.setLayout(new GridLayout());
child.createContents(client);
comp.setClient(client);
}
use of org.eclipse.ui.forms.events.ExpansionEvent in project webtools.sourceediting by eclipse.
the class AbstractValidationSettingsPage method createStyleSectionWithContentComposite.
protected Composite createStyleSectionWithContentComposite(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() {
public void expansionStateChanged(ExpansionEvent e) {
expandedStateChanged((ExpandableComposite) e.getSource());
}
});
fExpandables.add(excomposite);
makeScrollableCompositeAware(excomposite);
Composite inner = new Composite(excomposite, SWT.NONE);
inner.setFont(excomposite.getFont());
inner.setLayout(new GridLayout(nColumns, false));
excomposite.setClient(inner);
return inner;
}
use of org.eclipse.ui.forms.events.ExpansionEvent in project webtools.sourceediting by eclipse.
the class AbstractValidationSettingsPage method createStyleSection.
protected ExpandableComposite createStyleSection(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() {
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 webtools.sourceediting by eclipse.
the class XSLValidationPreferencePage 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());
}
});
Expandables.add(excomposite);
makeScrollableCompositeAware(excomposite);
return excomposite;
}
use of org.eclipse.ui.forms.events.ExpansionEvent in project netxms by netxms.
the class AlarmDetails method createDataSection.
/**
* Create data section
*/
private void createDataSection() {
final Section section = toolkit.createSection(form.getBody(), Section.TITLE_BAR | Section.EXPANDED | Section.TWISTIE | Section.COMPACT);
section.setText(Messages.get().AlarmDetails_LastValues);
final GridData gd = new GridData();
gd.horizontalAlignment = SWT.FILL;
gd.grabExcessHorizontalSpace = true;
gd.verticalAlignment = SWT.FILL;
gd.grabExcessVerticalSpace = true;
section.setLayoutData(gd);
section.addExpansionListener(new IExpansionListener() {
@Override
public void expansionStateChanging(ExpansionEvent e) {
gd.grabExcessVerticalSpace = e.getState();
}
@Override
public void expansionStateChanged(ExpansionEvent e) {
}
});
dataArea = toolkit.createComposite(section);
section.setClient(dataArea);
dataArea.setLayout(new FillLayout());
}
Aggregations