コード例 #1
0
 protected String getAddActionPath() {
   XModelObject o = helper.getModelObject();
   XActionList l =
       (XActionList) o.getModelEntity().getActionList().getItem("CreateActions"); // $NON-NLS-1$
   XActionItem[] is = l.getActionItems();
   if (is.length != 1 || !(is[0] instanceof XAction)) return null;
   return "CreateActions" + "." + is[0].getName(); // $NON-NLS-1$ //$NON-NLS-2$
 }
コード例 #2
0
 protected void edit() {
   XModelObject o = helper.getModelObject(xtable.getSelectionIndex());
   if (o == null) return;
   XActionList l = (XActionList) o.getModelEntity().getActionList();
   if (l.getAction("Edit") != null) { // $NON-NLS-1$
     callAction(o, "Edit"); // $NON-NLS-1$
   } else if (l.getAction("EditActions.Edit") != null) { // $NON-NLS-1$
     callAction(o, "EditActions.Edit"); // $NON-NLS-1$
   } else {
     callAction(o, "Properties.Properties"); // $NON-NLS-1$
   }
 }
コード例 #3
0
 public void setInput(Object object) {
   selected = (XModelObject) object;
   String[] h = editor.getHelper().getHeader();
   editor.getHelper().setEntity(selected.getModelEntity(), 0);
   if (h != editor.getHelper().getHeader()) {
     if (composite != null) {
       editor.getControl().dispose();
       editor.createControl(composite);
       composite.setWeights(new int[] {15, 30});
       composite.update();
       composite.layout();
     }
   }
   editor.setObject(selected);
   editor.update();
   properties.setInput(selected);
 }