示例#1
0
  private Bitmap loadDrawable(String fso) {
    final String filePath = (fso);

    try {
      if (Icons.isApk(filePath)) {
        return getAppDrawable(fso);
      } else if (Icons.isPicture(filePath)) {
        return loadImage(fso);
      } else if (Icons.isVideo(filePath)) return getVideoDrawable(fso);
    } catch (OutOfMemoryError outOfMemoryError) {
      cleanup();
      shutdownWorker();
    }

    return null;
  }
示例#2
0
 /** View the instance. */
 private Action getViewClsAction() {
   return new AbstractAction("View Cls", Icons.getViewIcon()) {
     public void actionPerformed(ActionEvent event) {
       viewObject();
     }
   };
 }
示例#3
0
 private Action getRemoveClsAction() {
   return new AbstractAction("Remove Cls", Icons.getRemoveIcon()) {
     public void actionPerformed(ActionEvent event) {
       removeInstance();
     }
   };
 }
示例#4
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);
      }
    };
  }
示例#5
0
 public Action_AddInstance(InstanceTableWidget widget) {
   super((widget.getState()).getAddInstanceButtonTooltip(), Icons.getAddIcon());
   _widget = widget;
   _dialogTitle = (widget.getState()).getAddInstanceDialogTitle();
 }