Esempio n. 1
0
 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 SModule module, boolean focus) {
   ProjectPane projectPane =
       ProjectPane.getInstance(ProjectHelper.toIdeaProject(context.getProject()));
   // TODO IModule cast
   projectPane.selectModule((IModule) module, focus);
 }
Esempio n. 3
0
  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);
      }
    }
  }