public Control createControl(Composite parent) { control = new Composite(parent, SWT.NONE); control.setLayout(bl); constants.createControl(control); dependency.createControl(control); enableComponent(-1); return control; }
public void setSelected(FModel fmodel) { if (selectedModel == fmodel) return; selectedModel = fmodel; if (selectedModel instanceof FConstantsModel) { currentEditor = constants; enableComponent(0); constants.setFModel(fmodel); dependency.setFModel(null); } else if (selectedModel instanceof FieldModel) { fmodel = ((FieldModel) fmodel).getDefaultDependency(); dependency.setFModel(fmodel); dependency.getFieldEditor().setEnabled(true); constants.setFModel(null); if (currentEditor != dependency) { currentEditor = dependency; enableComponent(1); } } else if (selectedModel instanceof DependencyModel) { dependency.setFModel(fmodel); dependency.getFieldEditor().setEnabled(false); constants.setFModel(null); if (currentEditor != dependency) { currentEditor = dependency; enableComponent(1); } } else if (currentEditor != null) { currentEditor = null; enableComponent(-1); constants.setFModel(null); constants.setFModel(null); } selectedModel = fmodel; control.getParent().update(); control.update(); control.layout(true); control.redraw(); }