java - Layouting the parent of a parent of a parent -


we have tool, has gui contains multiple sections. in these sections, have expandable composites not expanded default. when try expand these composites, + becomes -, stays closed:
expandable composite stays closed

to fix this, tried add expansionlistener:

expandablecomposite extendedconfiguration = gettoolkit().createexpandablecomposite(parent, tree_node); extendedconfiguration.setlayoutdata(new griddata(fill, center, true, false, 2, 1)); extendedconfiguration.settext("erweiterte einstellungen"); extendedconfiguration.setexpanded(false); extendedconfiguration.addexpansionlistener(new expansionadapter() {     @override     public void expansionstatechanged(expansionevent e) {         parent.getparent().getparent().layout();     } }); 

using dirty bit of code, works, parent composite of parent. parent of parent section itself, parent of section our view. not looks stupid, problematic when want change our view, parent of parent ... may won't right parent.

what correct way layout our view again? how can force ui draw contents of our expandablecomposite?

i think firing resize event should trick you

 parent.getparent().layout(true);  parent.getparent().notifylisteners(swt.resize, null); 

Comments

Popular posts from this blog

php - Why I am getting the Error "Commands out of sync; you can't run this command now" -

linux - Does gcc have any options to add version info in ELF binary file? -

java - Are there any classes that implement javax.persistence.Parameter<T>? -