当前位置: 首页>>代码示例>>Java>>正文


Java ToolWindowId类代码示例

本文整理汇总了Java中com.intellij.openapi.wm.ToolWindowId的典型用法代码示例。如果您正苦于以下问题:Java ToolWindowId类的具体用法?Java ToolWindowId怎么用?Java ToolWindowId使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


ToolWindowId类属于com.intellij.openapi.wm包,在下文中一共展示了ToolWindowId类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: previewRefactoring

import com.intellij.openapi.wm.ToolWindowId; //导入依赖的package包/类
@Override
protected void previewRefactoring(@NotNull final UsageInfo[] usages) {
  MigrationPanel panel = new MigrationPanel(myRoot[0], myLabeler, myProject, isPreviewUsages());
  String text;
  if (myRoot[0] instanceof PsiField) {
    text = "field \'" + ((PsiField)myRoot[0]).getName() + "\'";
  }
  else if (myRoot[0] instanceof PsiParameter) {
    text = "parameter \'" + ((PsiParameter)myRoot[0]).getName() + "\'";
  }
  else if (myRoot[0] instanceof PsiLocalVariable) {
    text = "variable \'" + ((PsiLocalVariable)myRoot[0]).getName() + "\'";
  }
  else if (myRoot[0] instanceof PsiMethod) {
    text = "method \'" + ((PsiMethod)myRoot[0]).getName() + "\' return";
  }
  else {
    text = Arrays.toString(myRoot);
  }
  String fromType = assertNotNull(TypeMigrationLabeler.getElementType(myRoot[0])).getPresentableText();
  String toType = myRules.getMigrationRootType().getPresentableText();
  String name = "Migrate Type of " + text + " from \'" + fromType + "\' to \'" + toType + "\'";
  Content content = UsageViewManager.getInstance(myProject).addContent(name, false, panel, true, true);
  panel.setContent(content);
  ToolWindowManager.getInstance(myProject).getToolWindow(ToolWindowId.FIND).activate(null);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:27,代码来源:TypeMigrationProcessor.java

示例2: setupImpl

import com.intellij.openapi.wm.ToolWindowId; //导入依赖的package包/类
public static void setupImpl(@NotNull Project project, boolean loadPaneExtensions) {
  ToolWindowManagerEx toolWindowManager = ToolWindowManagerEx.getInstanceEx(project);
  ToolWindow toolWindow = toolWindowManager.getToolWindow(ToolWindowId.PROJECT_VIEW);

  if (toolWindow == null) {
    ToolWindowEP[] beans = Extensions.getExtensions(ToolWindowEP.EP_NAME);
    for (final ToolWindowEP bean : beans) {
      if (bean.id.equals(ToolWindowId.PROJECT_VIEW)) {
        toolWindow = toolWindowManager.registerToolWindow(bean.id, new JLabel(), ToolWindowAnchor.fromText(bean.anchor), project,
                                                          false, bean.canCloseContents);
        break;
      }
    }
  }

  ((ProjectViewImpl)ProjectView.getInstance(project)).setupImpl(toolWindow, loadPaneExtensions);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:18,代码来源:ProjectViewTestUtil.java

示例3: MessageViewImpl

import com.intellij.openapi.wm.ToolWindowId; //导入依赖的package包/类
public MessageViewImpl(final Project project, final StartupManager startupManager, final ToolWindowManager toolWindowManager) {
  final Runnable runnable = new Runnable() {
    public void run() {
      myToolWindow = toolWindowManager.registerToolWindow(ToolWindowId.MESSAGES_WINDOW, true, ToolWindowAnchor.BOTTOM, project, true);
      myToolWindow.setIcon(AllIcons.Toolwindows.ToolWindowMessages);
      new ContentManagerWatcher(myToolWindow, getContentManager());
      for (Runnable postponedRunnable : myPostponedRunnables) {
        postponedRunnable.run();
      }
      myPostponedRunnables.clear();
    }
  };
  if (project.isInitialized()) {
    runnable.run();
  }
  else {
    startupManager.registerPostStartupActivity(new Runnable(){
      public void run() {
        runnable.run();
      }
    });
  }

}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:25,代码来源:MessageViewImpl.java

示例4: notifyByBalloon

import com.intellij.openapi.wm.ToolWindowId; //导入依赖的package包/类
public static void notifyByBalloon(@NotNull final Project project,
                                   final AbstractTestProxy root,
                                   final TestConsoleProperties properties,
                                   TestResultPresentation testResultPresentation) {
  if (project.isDisposed()) return;
  if (properties == null) return;

  TestStatusListener.notifySuiteFinished(root, properties.getProject());

  final String testRunDebugId = properties.isDebug() ? ToolWindowId.DEBUG : ToolWindowId.RUN;
  final ToolWindowManager toolWindowManager = ToolWindowManager.getInstance(project);

  final String title = testResultPresentation.getTitle();
  final String text = testResultPresentation.getText();
  final String balloonText = testResultPresentation.getBalloonText();
  final MessageType type = testResultPresentation.getType();

  if (!Comparing.strEqual(toolWindowManager.getActiveToolWindowId(), testRunDebugId)) {
    toolWindowManager.notifyByBalloon(testRunDebugId, type, balloonText, null, null);
  }

  NOTIFICATION_GROUP.createNotification(balloonText, type).notify(project);
  SystemNotifications.getInstance().notify("TestRunner", title, text);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:25,代码来源:TestsUIUtil.java

示例5: openMessagesView

import com.intellij.openapi.wm.ToolWindowId; //导入依赖的package包/类
public void openMessagesView(final VcsErrorViewPanel errorTreeView, final String tabDisplayName) {
  CommandProcessor commandProcessor = CommandProcessor.getInstance();
  commandProcessor.executeCommand(myProject, new Runnable() {
    public void run() {
      final MessageView messageView = MessageView.SERVICE.getInstance(myProject);
      messageView.runWhenInitialized(new Runnable() {
        public void run() {
          final Content content =
            ContentFactory.SERVICE.getInstance().createContent(errorTreeView, tabDisplayName, true);
          messageView.getContentManager().addContent(content);
          Disposer.register(content, errorTreeView);
          messageView.getContentManager().setSelectedContent(content);
          removeContents(content, tabDisplayName);

          ToolWindowManager.getInstance(myProject).getToolWindow(ToolWindowId.MESSAGES_WINDOW).activate(null);
        }
      });
    }
  }, VcsBundle.message("command.name.open.error.message.view"), null);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:21,代码来源:AbstractVcsHelperImpl.java

示例6: addView

import com.intellij.openapi.wm.ToolWindowId; //导入依赖的package包/类
public synchronized void addView(@NotNull InspectionResultsView view, @NotNull String title) {
  if (myContent != null) return;
  myContentManager.getValue().addContentManagerListener(new ContentManagerAdapter() {
    @Override
    public void contentRemoved(ContentManagerEvent event) {
      if (event.getContent() == myContent) {
        if (myView != null) {
          close(false);
        }
        myContent = null;
      }
    }
  });

  myView = view;
  myContent = ContentFactory.SERVICE.getInstance().createContent(view, title, false);

  myContent.setDisposer(myView);

  ContentManager contentManager = getContentManager();
  contentManager.addContent(myContent);
  contentManager.setSelectedContent(myContent);

  ToolWindowManager.getInstance(getProject()).getToolWindow(ToolWindowId.INSPECTION).activate(null);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:26,代码来源:GlobalInspectionContextImpl.java

示例7: getActiveDocComponent

import com.intellij.openapi.wm.ToolWindowId; //导入依赖的package包/类
@Nullable
public static DocumentationComponent getActiveDocComponent(@NotNull Project project) {
  DocumentationManager documentationManager = DocumentationManager.getInstance(project);
  DocumentationComponent component;
  JBPopup hint = documentationManager.getDocInfoHint();
  if (hint != null) {
    component = (DocumentationComponent)((AbstractPopup)hint).getComponent();
  }
  else if (documentationManager.hasActiveDockedDocWindow()) {
    ToolWindow toolWindow = ToolWindowManager.getInstance(project).getToolWindow(ToolWindowId.DOCUMENTATION);
    Content selectedContent = toolWindow == null ? null : toolWindow.getContentManager().getSelectedContent();
    component = selectedContent == null ? null : (DocumentationComponent)selectedContent.getComponent();
  }
  else {
    component = null;
  }
  return component;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:19,代码来源:QuickDocUtil.java

示例8: DependenciesAnalyzeManager

import com.intellij.openapi.wm.ToolWindowId; //导入依赖的package包/类
public DependenciesAnalyzeManager(final Project project) {
  myProject = project;
  StartupManager.getInstance(myProject).runWhenProjectIsInitialized(new Runnable() {
    @Override
    public void run() {
      ToolWindowManager toolWindowManager = ToolWindowManager.getInstance(myProject);
      ToolWindow toolWindow = toolWindowManager.registerToolWindow(ToolWindowId.MODULES_DEPENDENCIES,
                                                                   true,
                                                                   ToolWindowAnchor.RIGHT,
                                                                   project);
      myContentManager = toolWindow.getContentManager();
      toolWindow.setIcon(AllIcons.Toolwindows.ToolWindowModuleDependencies);
      new ContentManagerWatcher(toolWindow, myContentManager);
    }
  });
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:17,代码来源:DependenciesAnalyzeManager.java

示例9: configureProject

import com.intellij.openapi.wm.ToolWindowId; //导入依赖的package包/类
@Override
public void configureProject(final Project project, @NotNull final VirtualFile baseDir, Ref<Module> moduleRef) {
  StartupManager.getInstance(project).registerPostStartupActivity(new DumbAwareRunnable() {
    @Override
    public void run() {
      // ensure the dialog is shown after all startup activities are done
      SwingUtilities.invokeLater(new Runnable() {
        @Override
        public void run() {
          ApplicationManager.getApplication().invokeLater(new Runnable() {
            @Override
            public void run() {
              if (project.isDisposed()) return;
              final ToolWindow toolWindow = ToolWindowManager.getInstance(project).getToolWindow(ToolWindowId.PROJECT_VIEW);
              if (toolWindow != null && toolWindow.getType() != ToolWindowType.SLIDING) {
                toolWindow.activate(null);
              }
            }
          }, ModalityState.NON_MODAL);
        }
      });
    }
  });
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:25,代码来源:PlatformProjectViewOpener.java

示例10: DependenciesToolWindow

import com.intellij.openapi.wm.ToolWindowId; //导入依赖的package包/类
public DependenciesToolWindow(final Project project) {
  myProject = project;
  StartupManager.getInstance(project).runWhenProjectIsInitialized(new Runnable() {
    @Override
    public void run() {
      final ToolWindowManager toolWindowManager = ToolWindowManager.getInstance(myProject);
      if (toolWindowManager == null) return;
      ToolWindow toolWindow = toolWindowManager.registerToolWindow(ToolWindowId.DEPENDENCIES,
                                                                   true,
                                                                   ToolWindowAnchor.BOTTOM,
                                                                   project);
      myContentManager = toolWindow.getContentManager();

      toolWindow.setIcon(AllIcons.Toolwindows.ToolWindowInspection);
      new ContentManagerWatcher(toolWindow, myContentManager);
    }
  });
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:19,代码来源:DependenciesToolWindow.java

示例11: doSelectModuleOrGroup

import com.intellij.openapi.wm.ToolWindowId; //导入依赖的package包/类
private void doSelectModuleOrGroup(final Object toSelect, final boolean requestFocus) {
  ToolWindowManager windowManager=ToolWindowManager.getInstance(myProject);
  final Runnable runnable = new Runnable() {
    @Override
    public void run() {
      ProjectView projectView = ProjectView.getInstance(myProject);
      if (requestFocus) {
        projectView.changeView(getId(), getSubId());
      }
      ((BaseProjectTreeBuilder)getTreeBuilder()).selectInWidth(toSelect, requestFocus, new Condition<AbstractTreeNode>(){
        @Override
        public boolean value(final AbstractTreeNode node) {
          return node instanceof AbstractModuleNode || node instanceof ModuleGroupNode || node instanceof AbstractProjectNode;
        }
      });
    }
  };
  if (requestFocus) {
    windowManager.getToolWindow(ToolWindowId.PROJECT_VIEW).activate(runnable);
  }
  else {
    runnable.run();
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:25,代码来源:AbstractProjectViewPane.java

示例12: updateSelectionInActiveProjectView

import com.intellij.openapi.wm.ToolWindowId; //导入依赖的package包/类
static void updateSelectionInActiveProjectView(PsiElement newElement, Project project, boolean selectInActivePanel) {
  String id = ToolWindowManager.getInstance(project).getActiveToolWindowId();
  if (id != null) {
    ToolWindow window = ToolWindowManager.getInstance(project).getToolWindow(id);
    Content selectedContent = window.getContentManager().getSelectedContent();
    if (selectedContent != null) {
      JComponent component = selectedContent.getComponent();
      if (component instanceof TwoPaneIdeView) {
        ((TwoPaneIdeView) component).selectElement(newElement, selectInActivePanel);
        return;
      }
    }
  }
  if (ToolWindowId.PROJECT_VIEW.equals(id)) {
    ProjectView.getInstance(project).selectPsiElement(newElement, true);
  }
  else if (ToolWindowId.STRUCTURE_VIEW.equals(id)) {
    VirtualFile virtualFile = newElement.getContainingFile().getVirtualFile();
    FileEditor editor = FileEditorManager.getInstance(newElement.getProject()).getSelectedEditor(virtualFile);
    StructureViewFactoryEx.getInstanceEx(project).getStructureViewWrapper().selectCurrentElement(editor, virtualFile, true);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:23,代码来源:CopyHandler.java

示例13: openMessageViewImpl

import com.intellij.openapi.wm.ToolWindowId; //导入依赖的package包/类
private void openMessageViewImpl() {
  CommandProcessor commandProcessor = CommandProcessor.getInstance();
  commandProcessor.executeCommand(myProject, new Runnable() {
    @Override
    public void run() {
      MessageView messageView = MessageView.SERVICE.getInstance(myProject);
      Content content = ContentFactory.SERVICE.getInstance().createContent(myErrorsView.getComponent(), myContentName, true);
      content.putUserData(myKey, myErrorsView);
      messageView.getContentManager().addContent(content);
      messageView.getContentManager().setSelectedContent(content);
      messageView.getContentManager().addContentManagerListener(new CloseListener(content, myContentName, myErrorsView));
      removeOldContents(content);
      messageView.getContentManager().addContentManagerListener(new MyContentDisposer(content, messageView, myKey));
    }
  }, "Open Message View", null);

  ToolWindowManager.getInstance(myProject).getToolWindow(ToolWindowId.MESSAGES_WINDOW).activate(null);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:19,代码来源:MessageViewHelper.java

示例14: showSkipped

import com.intellij.openapi.wm.ToolWindowId; //导入依赖的package包/类
/**
 * Show skipped commits
 *
 * @param project        the context project
 * @param skippedCommits the skipped commits
 */
public static void showSkipped(final Project project, final SortedMap<VirtualFile, List<GitRebaseUtils.CommitInfo>> skippedCommits) {
  UIUtil.invokeLaterIfNeeded(new Runnable() {
    @Override
    public void run() {
      ContentManager contentManager = ProjectLevelVcsManagerEx.getInstanceEx(project).getContentManager();
      if (contentManager == null) {
        return;
      }
      GitSkippedCommits skipped = new GitSkippedCommits(contentManager, project, skippedCommits);
      Content content = ContentFactory.SERVICE.getInstance().createContent(skipped, "Skipped Commits", true);
      ContentsUtil.addContent(contentManager, content, true);
      ToolWindowManager.getInstance(project).getToolWindow(ToolWindowId.VCS).activate(null);
    }
  });
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:22,代码来源:GitSkippedCommits.java

示例15: actionPerformed

import com.intellij.openapi.wm.ToolWindowId; //导入依赖的package包/类
public void actionPerformed(final AnActionEvent e) {
  final Project project = e.getData(CommonDataKeys.PROJECT);
  if (project == null) {
    return;
  }

  final CopiesPanel copiesPanel = new CopiesPanel(project);
  ToolWindow toolWindow = ToolWindowManager.getInstance(project).getToolWindow(ToolWindowId.VCS);
  final ContentManager contentManager = toolWindow.getContentManager();

  Content content = ContentFactory.SERVICE.getInstance().createContent(copiesPanel.getComponent(), SvnBundle.message("dialog.show.svn.map.title"), true);
  ContentsUtil.addOrReplaceContent(contentManager, content, true);
  toolWindow.activate(new Runnable() {
    public void run() {
      IdeFocusManager.getInstance(project).requestFocus(copiesPanel.getPreferredFocusedComponent(), true);
    }
  });
  /*SwingUtilities.invokeLater(new Runnable() {
    public void run() {
      IdeFocusManager.getInstance(project).requestFocus(copiesPanel.getPrefferedFocusComponent(), true);
    }
  });*/
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:24,代码来源:ShowSvnMapAction.java


注:本文中的com.intellij.openapi.wm.ToolWindowId类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。