private Section createSection(SceneNodeComponent component) { FormToolkit toolkit = GurellaStudioPlugin.getToolkit(); Section section = toolkit.createSection(componentsComposite, TWISTIE | SHORT_TITLE_BAR | NO_TITLE_FOCUS_BOX); section.setText(MetaTypes.getMetaType(component).getName()); section.setLayoutData(new GridData(FILL, FILL, true, false, 1, 1)); section.addExpansionListener(new ExpansionListener(component)); BeanEditor<SceneNodeComponent> editor = createEditor(section, editorContext, component); Signal1<PropertyValueChangedEvent> signal = editor.getContext().propertiesSignal; signal.addListener(e -> notifySceneChanged()); section.setClient(editor); section.setExpanded(getPreferences().getBoolean(component.ensureUuid(), true)); editors.put(component, section); return section; }
@Override public void expansionStateChanged(ExpansionEvent e) { getPreferences().putBoolean(component.ensureUuid(), e.getState()); }