示例#1
0
  /** Get Select(+) Instance Action. */
  private Action getSelectClsAction() {
    return new AbstractAction("Select Cls", Icons.getAddIcon()) {
      public void actionPerformed(ActionEvent event) {

        if (instanceSlot == null) instanceSlot = getSlot();
        if (instanceSlot == null) return;
        Collection clses = instanceSlot.getAllowedParents();
        Instance instance = DisplayUtilities.pickCls(itsComp, getKB(), clses);

        if (instance != null) {
          setDisplayedInstance(instance);
          itsInstance = instance;
        }
        setActionsEnabled(true);
      }
    };
  }
示例#2
0
 public Action_AddInstance(InstanceTableWidget widget) {
   super((widget.getState()).getAddInstanceButtonTooltip(), Icons.getAddIcon());
   _widget = widget;
   _dialogTitle = (widget.getState()).getAddInstanceDialogTitle();
 }