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


Java ToolWindowManager.getInstance方法代码示例

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


在下文中一共展示了ToolWindowManager.getInstance方法的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: 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

示例3: 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

示例4: update

import com.intellij.openapi.wm.ToolWindowManager; //导入方法依赖的package包/类
@Override
public final void update(AnActionEvent e) {
  super.update(e);
  Presentation presentation = e.getPresentation();
  Project project = CommonDataKeys.PROJECT.getData(e.getDataContext());
  if (project == null) {
    presentation.setEnabled(false);
    return;
  }
  ToolWindowManager mgr=ToolWindowManager.getInstance(project);
  String id=mgr.getActiveToolWindowId();

  if (id == null) {
    presentation.setEnabled(false);
    return;
  }

  ToolWindow window = mgr.getToolWindow(id);

  if (window == null) {
    presentation.setEnabled(false);
    return;
  }

  update(window, presentation);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:27,代码来源:BaseToolWindowToggleAction.java

示例5: ensureToolWindowInitialized

import com.intellij.openapi.wm.ToolWindowManager; //导入方法依赖的package包/类
public static void ensureToolWindowInitialized(@NotNull Project project, @NotNull ProjectSystemId externalSystemId) {
  try {
    ToolWindowManager manager = ToolWindowManager.getInstance(project);
    if (!(manager instanceof ToolWindowManagerEx)) {
      return;
    }
    ToolWindowManagerEx managerEx = (ToolWindowManagerEx)manager;
    String id = externalSystemId.getReadableName();
    ToolWindow window = manager.getToolWindow(id);
    if (window != null) {
      return;
    }
    ToolWindowEP[] beans = Extensions.getExtensions(ToolWindowEP.EP_NAME);
    for (final ToolWindowEP bean : beans) {
      if (id.equals(bean.id)) {
        managerEx.initToolWindow(bean);
      }
    }
  }
  catch (Exception e) {
    LOG.error(String.format("Unable to initialize %s tool window", externalSystemId.getReadableName()), e);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:24,代码来源:ExternalSystemUtil.java

示例6: actionPerformed

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

  ToolWindowManager windowManager = ToolWindowManager.getInstance(project);

  if (windowManager.isEditorComponentActive()) {
    doNavigate(dataContext, project);
    return;
  }

  ContentManager contentManager = PlatformDataKeys.NONEMPTY_CONTENT_MANAGER.getData(dataContext);
  if (contentManager == null) return;
  doNavigate(contentManager);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:19,代码来源:TabNavigationActionBase.java

示例7: update

import com.intellij.openapi.wm.ToolWindowManager; //导入方法依赖的package包/类
public void update(AnActionEvent event){
  Presentation presentation = event.getPresentation();
  DataContext dataContext = event.getDataContext();
  Project project = CommonDataKeys.PROJECT.getData(dataContext);
  presentation.setEnabled(false);
  if (project == null) {
    return;
  }
  final ToolWindowManager windowManager = ToolWindowManager.getInstance(project);
  if (windowManager.isEditorComponentActive()) {
    final FileEditorManagerEx editorManager = FileEditorManagerEx.getInstanceEx(project);
    EditorWindow currentWindow = EditorWindow.DATA_KEY.getData(dataContext);
    if (currentWindow == null){
      editorManager.getCurrentWindow ();
    }
    if (currentWindow != null) {
      final VirtualFile[] files = currentWindow.getFiles();
      presentation.setEnabled(files.length > 1);
    }
    return;
  }

  ContentManager contentManager = PlatformDataKeys.NONEMPTY_CONTENT_MANAGER.getData(dataContext);
  presentation.setEnabled(contentManager != null && contentManager.getContentCount() > 1 && contentManager.isSingleSelection());
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:26,代码来源:TabNavigationActionBase.java

示例8: getWindow

import com.intellij.openapi.wm.ToolWindowManager; //导入方法依赖的package包/类
@Nullable
private ToolWindow getWindow(AnActionEvent event) {
  if (myWindow != null) return myWindow;

  Project project = CommonDataKeys.PROJECT.getData(event.getDataContext());
  if (project == null) return null;

  ToolWindowManager manager = ToolWindowManager.getInstance(project);

  final ToolWindow window = manager.getToolWindow(manager.getActiveToolWindowId());
  if (window == null) return null;

  final Component context = PlatformDataKeys.CONTEXT_COMPONENT.getData(event.getDataContext());
  if (context == null) return null;

  return SwingUtilities.isDescendingFrom(window.getComponent(), context) ? window : null;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:18,代码来源:ShowContentAction.java

示例9: createToolWindowContent

import com.intellij.openapi.wm.ToolWindowManager; //导入方法依赖的package包/类
@Override
    public void createToolWindowContent(@NotNull Project project, @NotNull ToolWindow toolWindow) {
        instance = this;
        this.project = project;
        toolWindow.setToHideOnEmptyContent(true);
        createContents(project, toolWindow);
        ToolWindowManager manager = ToolWindowManager.getInstance(project);
        if (manager instanceof ToolWindowManagerEx) {
            ToolWindowManagerEx managerEx = ((ToolWindowManagerEx) manager);
            managerEx.addToolWindowManagerListener(new ToolWindowManagerListener() {
                @Override
                public void toolWindowRegistered(@NotNull String id) {
                }

                @Override
                public void stateChanged() {
                    ToolWindow window = ToolWindowManager.getInstance(project).getToolWindow(IMWindowFactory.TOOL_WINDOW_ID);
                    if (window != null) {
                        boolean visible = window.isVisible();
                        if (visible && toolWindow.getContentManager().getContentCount() == 0) {
                            createContents(project, window);
                        }
                    }
                }
            });
        }

//        Disposer.register(project, new Disposable() {
//            @Override
//            public void dispose() {
//                if (panel != null && panel.isEnabled()) {
//                    panel.setEnabled(false);
//                    panel = null;
//                }
//            }
//        });
    }
 
开发者ID:Jamling,项目名称:SmartQQ4IntelliJ,代码行数:38,代码来源:IMWindowFactory.java

示例10: callProtractor

import com.intellij.openapi.wm.ToolWindowManager; //导入方法依赖的package包/类
private void callProtractor() {
    try {
        Config config = Config.getInstance(project);

        if (config == null) {
            return;
        }

        GeneralCommandLine command = getProtractorRunCommand(config);
        Process p = command.createProcess();

        if (project != null) {
            ToolWindowManager manager = ToolWindowManager.getInstance(project);
            String id = "Gherkin Runner";
            TextConsoleBuilderFactory factory = TextConsoleBuilderFactory.getInstance();
            TextConsoleBuilder builder = factory.createBuilder(project);
            ConsoleView view = builder.getConsole();

            ColoredProcessHandler handler = new ColoredProcessHandler(p, command.getPreparedCommandLine());
            handler.startNotify();
            view.attachToProcess(handler);

            ToolWindow window = manager.getToolWindow(id);
            Icon cucumberIcon = IconLoader.findIcon("/resources/icons/cucumber.png");

            if (window == null) {
                window = manager.registerToolWindow(id, true, ToolWindowAnchor.BOTTOM);
                window.setIcon(cucumberIcon);
            }

            ContentFactory cf = window.getContentManager().getFactory();
            Content c = cf.createContent(view.getComponent(), "Run " + (window.getContentManager().getContentCount() + 1), true);

            window.getContentManager().addContent(c);
        }
    } catch (Exception e) {
        System.out.println(e.getMessage());
    }
}
 
开发者ID:KariiO,项目名称:Gherkin-TS-Runner,代码行数:40,代码来源:GherkinIconRenderer.java

示例11: projectOpened

import com.intellij.openapi.wm.ToolWindowManager; //导入方法依赖的package包/类
@Override
public void projectOpened() {
    ToolWindowManager twm = ToolWindowManager.getInstance(this.project);
    this.cipherForm = new CipherForm();
    ToolWindow cipherToolWindow = twm.registerToolWindow(getComponentName(), false, ToolWindowAnchor.BOTTOM);
    ContentFactory contentFactory = ContentFactory.SERVICE.getInstance();
    Content content = contentFactory.createContent(this.cipherForm, "", false);
    cipherToolWindow.getContentManager().addContent(content);
    // called when project is opened
}
 
开发者ID:jiurongzhao,项目名称:Idea-Plugin-Cipher-tools,代码行数:11,代码来源:CipherTools.java

示例12: configure

import com.intellij.openapi.wm.ToolWindowManager; //导入方法依赖的package包/类
@Override
public void configure(
    @NotNull HybrisProjectDescriptor hybrisProjectDescriptor,
    @NotNull final List<HybrisModuleDescriptor> allModules,
    @NotNull final Project project
) {
    this.hybrisProjectDescriptor = hybrisProjectDescriptor;
    parseModules(allModules);
    if (platformDescriptor == null) {
        return;
    }
    final File platformDir = platformDescriptor.getRootDirectory();
    createAntInstallation(platformDir);
    if (antInstallation == null) {
        return;
    }
    createAntClassPath(platformDir);
    AntConfigurationBase.getInstance(project).setFilterTargets(true);
    antConfiguration = AntConfigurationBase.getInstance(project);
    final AntBuildFileBase buildFile = registerAntInstallation(platformDir, platformDir, desirablePlatformTargets);
    customHybrisModuleDescriptorList.forEach(
        e -> registerAntInstallation(platformDir, e.getRootDirectory(), desirableCustomTargets)
    );
    saveAntInstallation(antInstallation);
    removeMake(project);
    createMetaTargets(buildFile);

    final ToolWindowManager manager = ToolWindowManager.getInstance(project);
    final ToolWindow window = manager.getToolWindow("Ant Build");
    window.show(null);
}
 
开发者ID:AlexanderBartash,项目名称:hybris-integration-intellij-idea-plugin,代码行数:32,代码来源:DefaultAntConfigurator.java

示例13: projectOpened

import com.intellij.openapi.wm.ToolWindowManager; //导入方法依赖的package包/类
@Override
public void projectOpened() {
    Icon icon = IconLoader.getIcon(ICON_NYANDROID);
    ToolWindowManager toolWindowManager = ToolWindowManager.getInstance(project);
    ToolWindow toolWindow = toolWindowManager.getToolWindow("Logcat");
    if (toolWindow != null) {
        toolWindow.setIcon(icon);
    }
}
 
开发者ID:evant,项目名称:NyandroidRestorer,代码行数:10,代码来源:NyandroidProject.java

示例14: activateConsoleToolWindow

import com.intellij.openapi.wm.ToolWindowManager; //导入方法依赖的package包/类
private static void activateConsoleToolWindow(@NotNull Project project) {
    final ToolWindowManager manager = ToolWindowManager.getInstance(project);


    ToolWindow toolWindow = manager.getToolWindow(toolWindowId);
    if (toolWindow != null) {
        return;
    }

    toolWindow = manager.registerToolWindow(toolWindowId, true, ToolWindowAnchor.BOTTOM);
    final ConsoleView console = new ConsoleViewImpl(project, false);
    project.putUserData(CONSOLE_VIEW_KEY, console);
    toolWindow.getContentManager().addContent(new ContentImpl(console.getComponent(), "", false));

    final ToolWindowManagerListener listener = new ToolWindowManagerListener() {
        @Override
        public void toolWindowRegistered(@NotNull String id) {
        }

        @Override
        public void stateChanged() {
            ToolWindow window = manager.getToolWindow(toolWindowId);
            if (window != null && !window.isVisible()) {
                manager.unregisterToolWindow(toolWindowId);
                ((ToolWindowManagerEx) manager).removeToolWindowManagerListener(this);
            }
        }
    };

    toolWindow.show(new Runnable() {
        @Override
        public void run() {
            ((ToolWindowManagerEx) manager).addToolWindowManagerListener(listener);
        }
    });
}
 
开发者ID:internetisalie,项目名称:lua-for-idea,代码行数:37,代码来源:LuaSystemUtil.java

示例15: isSelected

import com.intellij.openapi.wm.ToolWindowManager; //导入方法依赖的package包/类
public boolean isSelected(AnActionEvent event){
  Project project = CommonDataKeys.PROJECT.getData(event.getDataContext());
  if (project == null) {
    return false;
  }
  ToolWindowManager windowManager = ToolWindowManager.getInstance(project);
  String id=windowManager.getActiveToolWindowId();
  if(id==null){
    return false;
  }
  return ToolWindowType.DOCKED==windowManager.getToolWindow(id).getType();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:13,代码来源:ToggleDockModeAction.java


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