public void doExecute(@NotNull final AnActionEvent event, final Map<String, Object> _params) {
   try {
     IEvaluationProvider evaluationProvider = DebugActionsUtil.getEvaluationProvider(event);
     if (evaluationProvider != null) {
       evaluationProvider.showEvaluationDialog(
           ((IOperationContext) MapSequence.fromMap(_params).get("operationContext")));
     }
   } catch (Throwable t) {
     if (log.isErrorEnabled()) {
       log.error("User's action execute method failed. Action:" + "EvaluateExpression", t);
     }
   }
 }
コード例 #2
0
 public void doExecute(@NotNull final AnActionEvent event, final Map<String, Object> _params) {
   try {
     IEvaluationProvider evaluationProvider = DebugActionsUtil.getEvaluationProvider(event);
     if (evaluationProvider != null) {
       final List<SNodeReference> nodePointers =
           ListSequence.fromList(new ArrayList<SNodeReference>());
       if (((EditorComponent) MapSequence.fromMap(_params).get("component")) != null) {
         final Selection selection =
             ((EditorComponent) MapSequence.fromMap(_params).get("component"))
                 .getSelectionManager()
                 .getSelection();
         if ((selection instanceof EditorCellLabelSelection
                 && ((EditorCellLabelSelection) selection).hasNonTrivialSelection())
             || (selection instanceof EditorCellSelection
                 && !((selection instanceof EditorCellLabelSelection)))
             || (selection instanceof MultipleSelection)) {
           ModelAccess.instance()
               .runReadAction(
                   new Runnable() {
                     public void run() {
                       ListSequence.fromList(nodePointers)
                           .addSequence(
                               Sequence.fromIterable(
                                       Sequence.fromClosure(
                                           new ISequenceClosure<SNode>() {
                                             public Iterable<SNode> iterable() {
                                               return selection.getSelectedNodes();
                                             }
                                           }))
                                   .select(
                                       new ISelector<SNode, SNodePointer>() {
                                         public SNodePointer select(SNode it) {
                                           return new SNodePointer(it);
                                         }
                                       }));
                     }
                   });
         }
       }
       evaluationProvider.showEvaluationDialog(
           ((IOperationContext) MapSequence.fromMap(_params).get("operationContext")),
           nodePointers);
     }
   } catch (Throwable t) {
     if (LOG.isEnabledFor(Level.ERROR)) {
       LOG.error("User's action execute method failed. Action:" + "EvaluateExpression", t);
     }
   }
 }
コード例 #3
0
 public void doUpdate(@NotNull AnActionEvent event, final Map<String, Object> _params) {
   try {
     {
       IEvaluationProvider evaluationProvider = DebugActionsUtil.getEvaluationProvider(event);
       event
           .getPresentation()
           .setEnabled(evaluationProvider != null && evaluationProvider.canEvaluate());
     }
   } catch (Throwable t) {
     if (LOG.isEnabledFor(Level.ERROR)) {
       LOG.error("User's action doUpdate method failed. Action:" + "EvaluateExpression", t);
     }
     this.disable(event.getPresentation());
   }
 }