RCP – Klapp ein, Klapp aus – Bestandteile der GUI aus- und einblenden

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: , ,

Kommentar verfassen

Trage deine Daten unten ein oder klicke ein Icon um dich einzuloggen:

WordPress.com-Logo

Du kommentierst mit Deinem WordPress.com-Konto. Log Out / Ändern )

Twitter-Bild

Du kommentierst mit Deinem Twitter-Konto. Log Out / Ändern )

Facebook-Foto

Du kommentierst mit Deinem Facebook-Konto. Log Out / Ändern )

Verbinde mit %s


Follow

Get every new post delivered to your Inbox.