コード例 #1
0
 public Control createControl(Composite parent) {
   control = new Composite(parent, SWT.NONE);
   control.setLayout(bl);
   constants.createControl(control);
   dependency.createControl(control);
   enableComponent(-1);
   return control;
 }
コード例 #2
0
 private void enableComponent(int i) {
   if (i == -1) {
     bl.centerComposite = null;
     constants.getControl().setVisible(false);
     dependency.getControl().setVisible(false);
     currentEditor = null;
   } else if (i == 0) {
     bl.centerComposite = constants.getControl();
     constants.getControl().setVisible(true);
     dependency.getControl().setVisible(false);
     constants.getControl().update();
   } else if (i == 1) {
     bl.centerComposite = dependency.getControl();
     constants.getControl().setVisible(false);
     dependency.getControl().setVisible(true);
     dependency.getControl().update();
   }
 }
コード例 #3
0
 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();
 }
コード例 #4
0
 public void update(FModel model) {
   if (currentEditor == constants) constants.update();
   if (currentEditor == dependency) dependency.update();
 }
コード例 #5
0
 public void set11() {
   dependency.set11();
 }