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


Java ToolWindowManager类代码示例

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


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

示例1: TelemetryToolWindow

import com.intellij.openapi.wm.ToolWindowManager; //导入依赖的package包/类
private TelemetryToolWindow(Project project) {
    ToolWindowManager manager = ToolWindowManager.getInstance(project);

    if (window == null) {
        textPane = new JTextPane();
        textPane.setEditable(false);

        JBScrollPane scrollPane = new JBScrollPane(textPane);
        DefaultCaret caret = (DefaultCaret) textPane.getCaret();
        caret.setUpdatePolicy(DefaultCaret.ALWAYS_UPDATE);

        textPane.setContentType("text/html");
        initHtmlComposer();

        window = manager.registerToolWindow(WINDOW_ID, scrollPane, ToolWindowAnchor.BOTTOM);
        window.show(EMPTY_TASK);
    }
}
 
开发者ID:andreyfomenkov,项目名称:green-cat,代码行数:19,代码来源:TelemetryToolWindow.java

示例2: getRNConsole

import com.intellij.openapi.wm.ToolWindowManager; //导入依赖的package包/类
/**
 * 获取 RN Console实例.
 *
 * @param displayName - the tab's display name must be unique.
 * @param icon        - used to set a tab icon, not used for search
 * @return
 */
public RNConsoleImpl getRNConsole(String displayName, Icon icon) {
    ToolWindow window = ToolWindowManager.getInstance(myProject).getToolWindow(RNToolWindowFactory.TOOL_WINDOW_ID);
    if (window != null) {
        Content existingContent = createConsoleTabContent(window, false, displayName, icon);
        if (existingContent != null) {
            final JComponent existingComponent = existingContent.getComponent();

            if (existingComponent instanceof SimpleToolWindowPanel) {
                JComponent component = ((SimpleToolWindowPanel) existingComponent).getContent();
                if (component instanceof RNConsoleImpl) {
                    RNConsoleImpl rnConsole = (RNConsoleImpl) component;
                    return rnConsole;
                }
            }
        }
    }

    return null;
}
 
开发者ID:beansoftapp,项目名称:react-native-console,代码行数:27,代码来源:ReactNativeConsole.java

示例3: updateTarget

import com.intellij.openapi.wm.ToolWindowManager; //导入依赖的package包/类
private void updateTarget() {
    targetPanel.setLayout(new GridLayout(0, 1, 0, 0));
    if (IMWindowFactory.getDefault() == null || IMWindowFactory.getDefault().getProject() == null) {
        return;
    }
    ToolWindow window = ToolWindowManager.getInstance(IMWindowFactory.getDefault().getProject()).getToolWindow(IMWindowFactory.TOOL_WINDOW_ID);
    if (window != null) {
        Content[] contents = window.getContentManager().getContents();
        if (contents != null) {
            for (Content content : contents) {
                if (content.getComponent() != null && content.getComponent() instanceof IMPanel) {
                    IMPanel panel = (IMPanel) content.getComponent();
                    List<IMChatConsole> chats = panel.getConsoleList();
                    if (!chats.isEmpty()) {
                        consoles.addAll(chats);
                        targetPanel.add(new GroupPanel(content.getDisplayName(), chats));
                    }
                }
            }
        }
    }
}
 
开发者ID:Jamling,项目名称:SmartQQ4IntelliJ,代码行数:23,代码来源:ReviewDialog.java

示例4: actionPerformed

import com.intellij.openapi.wm.ToolWindowManager; //导入依赖的package包/类
@Override
public void actionPerformed(AnActionEvent event)
{
    project = event.getProject();
    if (project == null)
    {
        return;
    }
    ToolWindowManager toolWindowMgr = ToolWindowManager.getInstance(project);
    ToolWindow tw = toolWindowMgr.getToolWindow(TOOL_WINDOW_ID);
    if (tw == null)
    {
        tw = toolWindowMgr.registerToolWindow(TOOL_WINDOW_ID, true, ToolWindowAnchor.BOTTOM, true);
    }
    final ToolWindow toolWindow = tw;
    toolWindow.activate(() -> updateContent(toolWindow, project.getName()), true);
}
 
开发者ID:miche-atucha,项目名称:deps-checker,代码行数:18,代码来源:CheckVersionAction.java

示例5: notifyByBallon

import com.intellij.openapi.wm.ToolWindowManager; //导入依赖的package包/类
@Override
public void notifyByBallon(String message, MessageType type)
{
    ToolWindowManager toolWindowMgr = ToolWindowManager.getInstance(project);
    toolWindowMgr.notifyByBalloon(TOOL_WINDOW_ID, type, message);
    if (MessageType.ERROR.equals(type))
    {
        LOG.error(message);
    }
    else if (MessageType.WARNING.equals(type))
    {
        LOG.warn(message);
    }
    else if (MessageType.INFO.equals(type))
    {
        LOG.info(message);
    }
}
 
开发者ID:miche-atucha,项目名称:deps-checker,代码行数:19,代码来源:CheckVersionAction.java

示例6: showConsoleToolWindow

import com.intellij.openapi.wm.ToolWindowManager; //导入依赖的package包/类
public void showConsoleToolWindow(final Project project, final ConsoleView... consoles) {
    Integer currentSelectedContentIndex = 0;
    if (toolWindow == null) {
        createNewToolWindow(project);
    } else if (!toolWindow.getTitle().equals("Hybris Console")) {
        final ToolWindow window = ToolWindowManager.getInstance(project).getToolWindow("Hybris Console");
        if (window == null) {
            createNewToolWindow(project);
        } else {
            toolWindow = window;
            currentSelectedContentIndex = getCurrentSelectedTab();
            toolWindow.getContentManager().removeAllContents(false);
        }
    } else {
        currentSelectedContentIndex = getCurrentSelectedTab();
        toolWindow.getContentManager().removeAllContents(false);
    }
    setConsolesInToolWindow(consoles);
    toolWindow.activate(null);
    selectTab(currentSelectedContentIndex);
}
 
开发者ID:AlexanderBartash,项目名称:hybris-integration-intellij-idea-plugin,代码行数:22,代码来源:ConsoleToolWindowUtil.java

示例7: projectClosed

import com.intellij.openapi.wm.ToolWindowManager; //导入依赖的package包/类
@Override
public void projectClosed() {
  final Course course = StudyTaskManager.getInstance(myProject).getCourse();
  if (course != null) {
    final ToolWindow toolWindow = ToolWindowManager.getInstance(myProject).getToolWindow(StudyToolWindowFactory.STUDY_TOOL_WINDOW);
    if (toolWindow != null) {
      toolWindow.getContentManager().removeAllContents(false);
    }
    KeymapManagerEx keymapManager = KeymapManagerEx.getInstanceEx();
    for (Keymap keymap : keymapManager.getAllKeymaps()) {
      List<Pair<String, String>> pairs = myDeletedShortcuts.get(keymap);
      if (pairs != null && !pairs.isEmpty()) {
        for (Pair<String, String> actionShortcut : pairs) {
          keymap.addShortcut(actionShortcut.first, new KeyboardShortcut(KeyStroke.getKeyStroke(actionShortcut.second), null));
        }
      }
    }
  }
  myListener = null;
}
 
开发者ID:medvector,项目名称:educational-plugin,代码行数:21,代码来源:StudyProjectComponent.java

示例8: showTestResultsToolWindow

import com.intellij.openapi.wm.ToolWindowManager; //导入依赖的package包/类
public static void showTestResultsToolWindow(@NotNull final Project project, @NotNull final String message) {
  ApplicationManager.getApplication().invokeLater(() -> {
    final ToolWindowManager toolWindowManager = ToolWindowManager.getInstance(project);
    ToolWindow window = toolWindowManager.getToolWindow(StudyTestResultsToolWindowFactoryKt.ID);
    if (window == null) {
      toolWindowManager.registerToolWindow(StudyTestResultsToolWindowFactoryKt.ID, true, ToolWindowAnchor.BOTTOM);
      window = toolWindowManager.getToolWindow(StudyTestResultsToolWindowFactoryKt.ID);
      new StudyTestResultsToolWindowFactory().createToolWindowContent(project, window);
    }

    final Content[] contents = window.getContentManager().getContents();
    for (Content content : contents) {
      final JComponent component = content.getComponent();
      if (component instanceof ConsoleViewImpl) {
        ((ConsoleViewImpl)component).clear();
        ((ConsoleViewImpl)component).print(message, ConsoleViewContentType.ERROR_OUTPUT);
        window.setAvailable(true,null);
        window.show(null);
      }
    }
  });
}
 
开发者ID:medvector,项目名称:educational-plugin,代码行数:23,代码来源:StudyCheckUtils.java

示例9: initFacet

import com.intellij.openapi.wm.ToolWindowManager; //导入依赖的package包/类
@Override
public void initFacet() {

    ApplicationManager.getApplication().invokeLater(new Runnable() {
        @Override
        public void run() {
            ToolWindowManager manager = ToolWindowManager.getInstance(MuleFacet.this.getModule().getProject());
            List<String> ids = Arrays.asList(manager.getToolWindowIds());

            if (manager.getToolWindow("Global Configs") == null && !ids.contains("Global Configs")) {

                try {
                    ToolWindow toolWindow = manager.registerToolWindow("Global Configs", true, ToolWindowAnchor.LEFT, false);
                    toolWindow.setIcon(MuleIcons.MuleIcon);

                    GlobalConfigsToolWindowPanel toolWindowPanel = new GlobalConfigsToolWindowPanel(MuleFacet.this.getModule().getProject());
                    ContentFactory contentFactory = ContentFactory.SERVICE.getInstance();
                    Content content = contentFactory.createContent(toolWindowPanel, "", true);
                    toolWindow.getContentManager().addContent(content);
                } catch (Exception e) {
                    logger.error("Unable to initialize toolWindow: ", e);
                }
            }
        }
    });
}
 
开发者ID:machaval,项目名称:mule-intellij-plugins,代码行数:27,代码来源:MuleFacet.java

示例10: rootsChanged

import com.intellij.openapi.wm.ToolWindowManager; //导入依赖的package包/类
@Override
public void rootsChanged(ModuleRootEvent event) {
  final ToolWindow window = ToolWindowManager.getInstance(myProject).getToolWindow(TOOL_WINDOW_ID);
  if (window == null) {
    return;
  }

  if (window.isDisposed() || !window.isVisible()) {
    return;
  }

  AndroidPlatform newPlatform = getPlatform();

  if (!Comparing.equal(myPrevPlatform, newPlatform)) {
    myPrevPlatform = newPlatform;
    ApplicationManager.getApplication().invokeLater(new Runnable() {
      @Override
      public void run() {
        if (!window.isDisposed() && window.isVisible()) {
          myView.activate();
        }
      }
    });
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:26,代码来源:AndroidToolWindowFactory.java

示例11: selectElement

import com.intellij.openapi.wm.ToolWindowManager; //导入依赖的package包/类
@Override
public void selectElement(final PsiElement element) {
  final boolean isDirectory = element instanceof PsiDirectory;
  if (!isDirectory) {
    EditorHelper.openInEditor(element);
  }
  ApplicationManager.getApplication().invokeLater(new Runnable() {
    @Override
    public void run() {
      myBuilder.selectElement(element, PsiUtilCore.getVirtualFile(element));
      if (!isDirectory) {
        ApplicationManager.getApplication().invokeLater(new Runnable() {
          @Override
          public void run() {
            if (myMoveFocus) {
              ToolWindowManager.getInstance(myProject).activateEditorComponent();
            }
          }
        });
      }
    }
  }, ModalityState.NON_MODAL);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:24,代码来源:CommanderPanel.java

示例12: createWindow

import com.intellij.openapi.wm.ToolWindowManager; //导入依赖的package包/类
public void createWindow(Project project) {
    jFXPanel = new JFXPanel();
    ToolWindow toolWindow = ToolWindowManager.getInstance(project).registerToolWindow("Basis.js", false, ToolWindowAnchor.BOTTOM, false);
    toolWindow.setIcon(IconLoader.getIcon("/icons/basisjs.png"));
    ContentFactory contentFactory = ContentFactory.SERVICE.getInstance();
    Content content = contentFactory.createContent(jFXPanel, "inspector", false);
    toolWindow.getContentManager().addContent(content);

    InspectorController sceneInspectorController = new InspectorController();
    FXMLLoader fxmlLoader = new FXMLLoader();
    fxmlLoader.setLocation(getClass().getResource("/com/basisjs/ui/windows/tools/inspector/InspectorScene.fxml"));
    fxmlLoader.setController(sceneInspectorController);

    Platform.setImplicitExit(false);
    PlatformImpl.runLater(() -> {
        try {
            Scene scene = new Scene(fxmlLoader.load());
            jFXPanel.setScene(scene);
            webView = sceneInspectorController.webView;
            webView.setContextMenuEnabled(false);
        } catch (IOException e) {
            e.printStackTrace();
        }
    });
}
 
开发者ID:smelukov,项目名称:intellij-basisjs-plugin,代码行数:26,代码来源:InspectorWindow.java

示例13: openToolWindow

import com.intellij.openapi.wm.ToolWindowManager; //导入依赖的package包/类
public void openToolWindow(Project project) {
    logger.info("Opening tool window. @OpenToolWindowAction");
    if (project == null) {
        logger.warn("project was null ending openToolWindow @OpenToolWindowAction");
        return;
    }
    ToolWindow projectList = null;

    if (ToolWindowManager.getInstance(project).getToolWindow("Project") != null) {
        projectList = ToolWindowManager.getInstance(project).getToolWindow("TMC Project List");
    }

    if (projectList == null) {
        logger.warn("ToolWindow was null ending openToolWindow @OpenToolwindowAction");
        return;
    }

    if (projectList.isVisible()) {
        projectList.hide(null);
    } else {
        ToolWindowManager.getInstance(project).getToolWindow("TMC Project List").show(null);
        ToolWindowManager.getInstance(project);
    }
}
 
开发者ID:testmycode,项目名称:tmc-intellij,代码行数:25,代码来源:OpenToolWindowAction.java

示例14: initToolWindow

import com.intellij.openapi.wm.ToolWindowManager; //导入依赖的package包/类
@Override
protected void initToolWindow() {
  myToolWindow = ToolWindowManager.getInstance(myProject).registerToolWindow(UIDesignerBundle.message("toolwindow.ui.designer.name"),
                                                                             false, getAnchor(), myProject, true);
  myToolWindow.setIcon(UIDesignerIcons.ToolWindowUIDesigner);

  if (!ApplicationManager.getApplication().isHeadlessEnvironment()) {
    myToolWindow.getComponent().putClientProperty(ToolWindowContentUi.HIDE_ID_LABEL, "true");
  }

  initGearActions();

  ContentManager contentManager = myToolWindow.getContentManager();
  Content content =
    contentManager.getFactory()
      .createContent(myToolWindowPanel.getToolWindowPanel(), UIDesignerBundle.message("toolwindow.ui.designer.title"), false);
  content.setCloseable(false);
  content.setPreferredFocusableComponent(myToolWindowPanel.getComponentTree());
  contentManager.addContent(content);
  contentManager.setSelectedContent(content, true);
  myToolWindow.setAvailable(false, null);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:23,代码来源:DesignerToolWindowManager.java

示例15: actionPerformed

import com.intellij.openapi.wm.ToolWindowManager; //导入依赖的package包/类
@Override
public void actionPerformed(AnActionEvent e) {
    //Get required data keys
    final Project project = e.getData(CommonDataKeys.PROJECT);
    final Editor editor = e.getData(CommonDataKeys.EDITOR);

    //Generate the autoQuery
    String autoQuery = project.getComponent(TermStatComponent.class).generateQuery(editor);

    //Execute Search and Open Tool Window
    ToolWindow toolWindow = ToolWindowManager.getInstance(project).getToolWindow("StackInTheFlow");
    SearchToolWindowGUI toolWindowGUI = project.getComponent(ToolWindowComponent.class).getSearchToolWindowGUI();
    toolWindowGUI.autoQuery(autoQuery, true, "action");
    toolWindow.activate(() -> {
    });
}
 
开发者ID:vcu-swim-lab,项目名称:stack-intheflow,代码行数:17,代码来源:AutoQueryAction.java


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