public void doExecute(@NotNull final AnActionEvent event, final Map<String, Object> _params) {
   try {
     NewSolutionDialog dialog =
         new NewSolutionDialog(((Frame) MapSequence.fromMap(_params).get("frame")));
     dialog.setProject(((MPSProject) MapSequence.fromMap(_params).get("project")));
     dialog.show();
     final Solution s = dialog.getResult();
     if (s == null) {
       return;
     }
     ModelAccess.instance()
         .runWriteAction(
             new Runnable() {
               public void run() {
                 ((StandaloneMPSProject)
                         ((MPSProject) MapSequence.fromMap(_params).get("project")))
                     .setFolderFor(
                         s,
                         (((String) MapSequence.fromMap(_params).get("namespace")) == null
                             ? ""
                             : ((String) MapSequence.fromMap(_params).get("namespace"))));
               }
             });
     ProjectPane projectPane =
         ProjectPane.getInstance(((Project) MapSequence.fromMap(_params).get("ideaProject")));
     projectPane.rebuildTree();
     projectPane.selectModule(s, false);
   } catch (Throwable t) {
     LOG.error("User's action execute method failed. Action:" + "NewSolution", t);
   }
 }
 @Override
 public void selectInTree(
     @NotNull IOperationContext context, @NotNull SModel model, boolean focus) {
   ProjectPane projectPane =
       ProjectPane.getInstance(ProjectHelper.toIdeaProject(context.getProject()));
   projectPane.selectModel(model, focus);
 }
 @Override
 public void selectInTree(
     @NotNull IOperationContext context, @NotNull SModule module, boolean focus) {
   ProjectPane projectPane =
       ProjectPane.getInstance(ProjectHelper.toIdeaProject(context.getProject()));
   // TODO IModule cast
   projectPane.selectModule((IModule) module, focus);
 }
    @Override
    public void exitDumbMode() {
      if (!ProjectPane.isShowGenStatus()) return;

      Project p = myTree.getProject();
      if (p.isDisposed()) return;

      myGenStatusVisitor.dispatchForHierarchy(myTree.getRootNode());
    }
Exemple #5
0
    private void execute_internal(
        final KeyEvent keyEvent,
        final EditorContext editorContext,
        final SNode node,
        final List<SNode> selectedNodes) {
      IOperationContext operationContext = editorContext.getOperationContext();

      Project project = operationContext.getProject();
      ProjectPane.getInstance(ProjectHelper.toIdeaProject(project))
          .selectModule(Module_Behavior.call_getModule_1213877515148(node), false);
    }
  public void doExecute(@NotNull final AnActionEvent event, final Map<String, Object> _params) {
    try {
      NewLanguageDialog dialog =
          new NewLanguageDialog(
              ((MPSProject) MapSequence.fromMap(_params).get("project")),
              ((String) MapSequence.fromMap(_params).get("namespace")));
      dialog.show();

      Language l = dialog.getLangauge();
      if (l == null) {
        return;
      }
      ProjectPane projectPane =
          ProjectPane.getInstance(((Project) MapSequence.fromMap(_params).get("ideaProject")));
      projectPane.rebuildTree();
      projectPane.selectModule(l, false);
    } catch (Throwable t) {
      if (LOG.isEnabledFor(Priority.ERROR)) {
        LOG.error("User's action execute method failed. Action:" + "NewLanguage", t);
      }
    }
  }
 @Override
 public void doubleClick() {
   Project project = getProject();
   final SRepository r = ProjectHelper.getProjectRepository(project);
   SModule m =
       (r == null
           ? null
           : new ModelAccessHelper(r)
               .runReadAction(
                   new Computable<SModule>() {
                     public SModule compute() {
                       return myModule.resolve(r);
                     }
                   }));
   if (m == null) {
     return;
   }
   ProjectPane.getInstance(project).selectModule(m, false);
 }
 @Override
 public void enteredDumbMode() {
   if (!ProjectPane.isShowGenStatus()) return;
   myGenStatusVisitor.dispatchForHierarchy(myTree.getRootNode());
 }
 private boolean showPropertiesAndReferences(SModelTreeNode node) {
   Project project = node.getOperationContext().getProject();
   return node.getTree() instanceof LogicalViewTree
       && ProjectPane.getInstance(ProjectHelper.toIdeaProject(project))
           .isShowPropertiesAndReferences();
 }