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


Java ToolWindow.show方法代码示例

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


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

示例1: actionPerformed

import com.intellij.openapi.wm.ToolWindow; //导入方法依赖的package包/类
public void actionPerformed(AnActionEvent e) {
  Project project = e.getData(CommonDataKeys.PROJECT);
  if (project == null) {
    RepositoryBrowserDialog dialog = new RepositoryBrowserDialog(ProjectManager.getInstance().getDefaultProject());
    dialog.show();
  }
  else {
    ToolWindowManager manager = ToolWindowManager.getInstance(project);
    ToolWindow w = manager.getToolWindow(REPOSITORY_BROWSER_TOOLWINDOW);
    if (w == null) {
      RepositoryToolWindowPanel component = new RepositoryToolWindowPanel(project);
      w = manager.registerToolWindow(REPOSITORY_BROWSER_TOOLWINDOW, true, ToolWindowAnchor.BOTTOM, project, true);
      final Content content = ContentFactory.SERVICE.getInstance().createContent(component, "", false);
      Disposer.register(content, component);
      w.getContentManager().addContent(content);
    }
    w.show(null);
    w.activate(null);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:21,代码来源:BrowseRepositoryAction.java

示例2: batchPerform

import com.intellij.openapi.wm.ToolWindow; //导入方法依赖的package包/类
protected void batchPerform(Project project, final SvnVcs activeVcs, VirtualFile[] file, DataContext context) throws VcsException {
  final File[] ioFiles = new File[file.length];
  for (int i = 0; i < ioFiles.length; i++) {
    ioFiles[i] = new File(file[i].getPath());
  }
  if (ioFiles.length > 0) {
    ToolWindow w = ToolWindowManager.getInstance(project).getToolWindow(PropertiesComponent.ID);
    PropertiesComponent component = null;
    if (w == null) {
      component = new PropertiesComponent();
      w = ToolWindowManager.getInstance(project).registerToolWindow(PropertiesComponent.ID, component, ToolWindowAnchor.BOTTOM);
    } else {
      component = ((PropertiesComponent) w.getContentManager().getContents()[0].getComponent());
    }
    w.setTitle(ioFiles[0].getName());
    w.show(null);
    final PropertiesComponent comp = component;
    w.activate(new Runnable() {
      public void run() {
        comp.setFile(activeVcs, ioFiles[0]);
      }
    });
  }

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

示例3: initTerminal

import com.intellij.openapi.wm.ToolWindow; //导入方法依赖的package包/类
public void initTerminal(final ToolWindow toolWindow) {
        toolWindow.setToHideOnEmptyContent(true);
        toolWindow.setStripeTitle("RN Console");
        toolWindow.setIcon(PluginIcons.React);
        Content content = createConsoleTabContent(toolWindow, true, "Welcome", null);
//        toolWindow.getContentManager().addContent(content);
//        toolWindow.getContentManager().addContent(new ContentImpl(new JButton("Test"), "Build2", false));

        // ======= test a terminal create ======
//        LocalTerminalDirectRunner terminalRunner = LocalTerminalDirectRunner.createTerminalRunner(myProject);
//        Content testTerminalContent = createTerminalInContentPanel(terminalRunner, toolWindow);
//        toolWindow.getContentManager().addContent(testTerminalContent);

//        SimpleTerminal term  = new SimpleTerminal();
//        term.sendString("ls\n");
//        toolWindow.getContentManager().addContent(new ContentImpl(term.getComponent(), "terminal", false));
        toolWindow.setShowStripeButton(true);// if set to false, then sometimes the window will be hidden from the dock area for ever 2017-05-26
//        toolWindow.setTitle(" - ");
        ((ToolWindowManagerEx) ToolWindowManager.getInstance(this.myProject)).addToolWindowManagerListener(new ToolWindowManagerListener() {
            @Override
            public void toolWindowRegistered(@NotNull String s) {
            }

            @Override
            public void stateChanged() {
                ToolWindow window = ToolWindowManager.getInstance(myProject).getToolWindow(RNToolWindowFactory.TOOL_WINDOW_ID);
                if (window != null) {
                    boolean visible = window.isVisible();
                    if (visible && toolWindow.getContentManager().getContentCount() == 0) {
                        initTerminal(window);
                    }
                }
            }
        });
        toolWindow.show(null);
    }
 
开发者ID:beansoftapp,项目名称:react-native-console,代码行数:37,代码来源:ReactNativeConsole.java

示例4: initTerminal

import com.intellij.openapi.wm.ToolWindow; //导入方法依赖的package包/类
public void initTerminal(final ToolWindow toolWindow) {
    toolWindow.setToHideOnEmptyContent(true);
    LocalTerminalDirectRunner terminalRunner = LocalTerminalDirectRunner.createTerminalRunner(myProject);
    myTerminalRunner = terminalRunner;
    toolWindow.setStripeTitle("React Native");
    Content content = createTerminalInContentPanel(terminalRunner, toolWindow);
    toolWindow.getContentManager().addContent(content);
    toolWindow.setShowStripeButton(true);
    toolWindow.setTitle("Console");
    ((ToolWindowManagerEx) ToolWindowManager.getInstance(this.myProject)).addToolWindowManagerListener(new ToolWindowManagerListener() {
        @Override
        public void toolWindowRegistered(@NotNull String s) {

        }

        @Override
        public void stateChanged() {
            ToolWindow window = ToolWindowManager.getInstance(myProject).getToolWindow(RNToolWindowFactory.TOOL_WINDOW_ID);
            if (window != null) {
                boolean visible = window.isVisible();
                if (visible && toolWindow.getContentManager().getContentCount() == 0) {
                    initTerminal(window);
                }
            }
        }
    });
    toolWindow.show(null);
    JBTabbedTerminalWidget terminalWidget = getTerminalWidget(toolWindow);
    if (terminalWidget != null && terminalWidget.getCurrentSession() != null) {
        Terminal terminal = terminalWidget.getCurrentSession().getTerminal();
        if (terminal != null) {
            terminal.setCursorVisible(true);// 是否启用光标 BeanSoft
        }
    }
}
 
开发者ID:beansoftapp,项目名称:react-native-console,代码行数:36,代码来源:ReactNativeTerminal.java

示例5: configure

import com.intellij.openapi.wm.ToolWindow; //导入方法依赖的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

示例6: editorCreated

import com.intellij.openapi.wm.ToolWindow; //导入方法依赖的package包/类
@Override
public void editorCreated(@NotNull final EditorFactoryEvent event) {
  final Editor editor = event.getEditor();
  final Project project = editor.getProject();
  if (project == null) {
    return;
  }

  final Document document = editor.getDocument();
  final VirtualFile openedFile = FileDocumentManager.getInstance().getFile(document);
  if (openedFile != null) {
    final TaskFile taskFile = StudyUtils.getTaskFile(project, openedFile);
    if (taskFile != null) {
      WolfTheProblemSolver.getInstance(project).clearProblems(openedFile);
      final ToolWindow studyToolWindow = ToolWindowManager.getInstance(project).getToolWindow(StudyToolWindowFactory.STUDY_TOOL_WINDOW);
      if (studyToolWindow != null) {
        StudyUtils.updateToolWindows(project);
        studyToolWindow.show(null);
      }
      Course course = StudyTaskManager.getInstance(project).getCourse();
      if (course == null) {
        return;
      }

      StudyEditor.addDocumentListener(document, new EduDocumentListener(taskFile, true));

      if (!taskFile.getAnswerPlaceholders().isEmpty()) {
        StudyNavigator.navigateToFirstAnswerPlaceholder(editor, taskFile);
        boolean isStudyProject = EduNames.STUDY.equals(course.getCourseMode());
        StudyUtils.drawAllAnswerPlaceholders(editor, taskFile);
        if (isStudyProject) {
          editor.addEditorMouseListener(new WindowSelectionListener(taskFile));
        }
      }
    }
  }
}
 
开发者ID:medvector,项目名称:educational-plugin,代码行数:38,代码来源:StudyEditorFactoryListener.java

示例7: activateConsoleToolWindow

import com.intellij.openapi.wm.ToolWindow; //导入方法依赖的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

示例8: actionPerformed

import com.intellij.openapi.wm.ToolWindow; //导入方法依赖的package包/类
@Override
public void actionPerformed(AnActionEvent e) {
    if (e.getProject() != null) {
        ToolWindow basisJsToolWindow = ToolWindowManager.getInstance(e.getProject()).getToolWindow("Basis.js");
        basisJsToolWindow.show(() -> {
        });
    }
}
 
开发者ID:smelukov,项目名称:intellij-basisjs-plugin,代码行数:9,代码来源:BasisJSShowInspectorAction.java

示例9: initTerminal

import com.intellij.openapi.wm.ToolWindow; //导入方法依赖的package包/类
public void initTerminal(final ToolWindow toolWindow) {
    toolWindow.setToHideOnEmptyContent(true);
    LocalTerminalDirectRunner terminalRunner = LocalTerminalDirectRunner.createTerminalRunner(myProject);
    toolWindow.setStripeTitle("Fastdex");
    Content content = createTerminalInContentPanel(terminalRunner, toolWindow);
    toolWindow.getContentManager().addContent(content);
    toolWindow.setShowStripeButton(true);
    toolWindow.setTitle("Console");
    ((ToolWindowManagerEx) ToolWindowManager.getInstance(this.myProject)).addToolWindowManagerListener(new ToolWindowManagerListener() {
        @Override
        public void toolWindowRegistered(@NotNull String s) {

        }

        @Override
        public void stateChanged() {
            ToolWindow window = ToolWindowManager.getInstance(myProject).getToolWindow(FastdexToolWindowFactory.TOOL_WINDOW_ID);
            if (window != null) {
                boolean visible = window.isVisible();
                if (visible && toolWindow.getContentManager().getContentCount() == 0) {
                    initTerminal(window);
                }
            }
        }
    });
    toolWindow.show(null);
    JBTabbedTerminalWidget terminalWidget = getTerminalWidget(toolWindow);
    if (terminalWidget != null && terminalWidget.getCurrentSession() != null) {
        Terminal terminal = terminalWidget.getCurrentSession().getTerminal();
        if (terminal != null) {
            terminal.setCursorVisible(false);
        }
    }
}
 
开发者ID:typ0520,项目名称:fastdex,代码行数:35,代码来源:FastdexTerminal.java

示例10: getToolWindow

import com.intellij.openapi.wm.ToolWindow; //导入方法依赖的package包/类
public ToolWindow getToolWindow() {
    ToolWindow toolWindow;

    String windowId = "atoum";
    if (!Arrays.asList(ToolWindowManager.getInstance(project).getToolWindowIds()).contains(windowId)) {
        toolWindow = ToolWindowManager.getInstance(project).registerToolWindow(windowId, false, ToolWindowAnchor.BOTTOM);
    } else {
        toolWindow = ToolWindowManager.getInstance(project).getToolWindow(windowId);
    }

    toolWindow.setIcon(Icons.ATOUM);
    toolWindow.show(null);

    return toolWindow;
}
 
开发者ID:atoum,项目名称:phpstorm-plugin,代码行数:16,代码来源:Runner.java

示例11: openTab

import com.intellij.openapi.wm.ToolWindow; //导入方法依赖的package包/类
private void openTab(final BaseFrameController controller, String tabTitle) {
    ApplicationManager.getApplication().assertIsDispatchThread();
    final ToolWindow toolWindow = getToolWindow();
    final ContentManager toolwindowCM = toolWindow.getContentManager();
    final ContentFactory contentFactory = ContentFactory.SERVICE.getInstance();

    // clean up previous tab
    boolean toolWindowOpen = currentFrame == null;
    if (currentFrame != null) {
        toolwindowCM.removeContent(toolwindowCM.getContent(currentFrame.getControlPanel()), true);
        Disposer.dispose(currentFrame);
    }

    // add new content
    currentFrame = controller;
    Content newToolWindowTab = contentFactory.createContent(currentFrame.getControlPanel(), tabTitle, false);
    toolwindowCM.addContent(newToolWindowTab);
    toolwindowCM.setSelectedContent(newToolWindowTab);

    // make sure the toolwindow is visible
    toolWindow.show(new Runnable() {
        @Override
        public void run() {
            JComponent view = (JComponent) currentFrame.view;
            view.revalidate();
            view.repaint();
            TrackingService.trace(IdeaRawEvent.toolWindowShowContent(project, controller));
        }
    });
}
 
开发者ID:samebug,项目名称:samebug-idea-plugin,代码行数:31,代码来源:ToolWindowController.java

示例12: updateWindowAvailable

import com.intellij.openapi.wm.ToolWindow; //导入方法依赖的package包/类
private void updateWindowAvailable(boolean showIfAvailable) {
  boolean available = ServersToolWindowFactory.isAvailable(myProject);

  final ToolWindowManager toolWindowManager = ToolWindowManager.getInstance(myProject);
  final ToolWindow toolWindow = toolWindowManager.getToolWindow(WINDOW_ID);

  if (toolWindow == null) {
    if (available) {
      toolWindowManager.invokeLater(new Runnable() {

        @Override
        public void run() {
          createToolWindow(myProject, toolWindowManager).show(null);
        }
      });
    }
    return;
  }

  boolean doShow = !toolWindow.isAvailable() && available;
  if (toolWindow.isAvailable() && !available) {
    toolWindow.hide(null);
  }
  toolWindow.setAvailable(available, null);
  if (showIfAvailable && doShow) {
    toolWindow.show(null);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:29,代码来源:ServersToolWindowManager.java

示例13: showToolWindow

import com.intellij.openapi.wm.ToolWindow; //导入方法依赖的package包/类
void showToolWindow(boolean activateWindow) {
  ToolWindow toolWindow = ToolWindowManager.getInstance(myProject).getToolWindow(ToolWindowId.FIND);
  toolWindow.show(null);
  if (activateWindow && !toolWindow.isActive()) {
    toolWindow.activate(null);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:8,代码来源:UsageViewManagerImpl.java

示例14: actionPerformed

import com.intellij.openapi.wm.ToolWindow; //导入方法依赖的package包/类
@Override
protected void actionPerformed(@NotNull VcsContext e) {
  if (e.getProject() == null) return;
  final ToolWindowManager manager = ToolWindowManager.getInstance(e.getProject());
  if (manager != null) {
    final ToolWindow window = manager.getToolWindow(ChangesViewContentManager.TOOLWINDOW_ID);
    if (window != null) {
      window.show(null);
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:12,代码来源:ShowChangesViewAction.java

示例15: select

import com.intellij.openapi.wm.ToolWindow; //导入方法依赖的package包/类
public static ActionCallback select(@NotNull Project project,
                                    final Object toSelect,
                                    @Nullable final String viewId,
                                    @Nullable final String subviewId,
                                    final VirtualFile virtualFile,
                                    final boolean requestFocus) {
  final ActionCallback result = new ActionCallback();

  ToolWindowManager windowManager = ToolWindowManager.getInstance(project);
  final ToolWindow favoritesToolWindow = windowManager.getToolWindow(ToolWindowId.FAVORITES_VIEW);

  if (favoritesToolWindow != null) {
    final FavoritesTreeViewPanel panel = UIUtil.findComponentOfType(favoritesToolWindow.getComponent(), FavoritesTreeViewPanel.class);

    if (panel != null) {
      final Runnable runnable = new Runnable() {
        @Override
        public void run() {
          panel.selectElement(toSelect, virtualFile, requestFocus);
          result.setDone();
        }
      };

      if (requestFocus) {
        favoritesToolWindow.activate(runnable, false);
      }
      else {
        favoritesToolWindow.show(runnable);
      }
    }
  }

  return result;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:35,代码来源:FavoritesViewSelectInTarget.java


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