Section expandableSection= toolkit.createSection ( composite, Section.EXPANDED | Section.TITLE_BAR | Section.TWISTIE | Section.EXPANDED | Section.DESCRIPTION );
expandableSection.setText(“Titel”);
expandableSection.setDescription ( “Beschreibung” );
MyComposite composite= new MyComposite(expandableSection);
//+setClient bestimmt welche Komponente angezeigt wird, sobald ausgeklappt wird
expandableSection.setClient ( composite);
//+reflow berechnet das Layout neu; dieses muss gemacht werden, sobald eine expansion statt findet
expandableSection.addExpansionListener( new ExpansionAdapter() {
public void expansionStateChanged( ExpansionEvent e ) {
managedForm.reflow( true );
}
} );
//—————oder so————————
ExpandableComposite exp= toolkit.createExpandableComposite(composite,
ExpandableComposite.TWISTIE|
ExpandableComposite.CLIENT_INDENT);
exp.setText(“Titel”);
MyComposite composite = new MyComposite(exp);
//+setClient bestimmt welche Komponente angezeigt wird, sobald ausgeklappt wird
exp.setClient(composite);
//+reflow berechnet das Layout neu; dieses muss gemacht werden, sobald eine Expansion statt findet
exp.addExpansionListener(new ExpansionAdapter() {
public void expansionStateChanged(ExpansionEvent e) {
managedForm.reflow(true);
}
});
Tags: org.eclipse.ui.forms.widgets.ExpandableComposite, org.eclipse.ui.forms.widgets.Section, setClient