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


Java ToolWindow.hide方法代码示例

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


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

示例1: openToolWindow

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

示例2: actionPerformed

import com.intellij.openapi.wm.ToolWindow; //导入方法依赖的package包/类
public void actionPerformed(AnActionEvent e) {
  ContentManager contentManager = ContentManagerUtil.getContentManagerFromContext(e.getDataContext(), true);
  boolean processed = false;
  if (contentManager != null && contentManager.canCloseContents()) {
    final Content selectedContent = contentManager.getSelectedContent();
    if (selectedContent != null && selectedContent.isCloseable()) {
      contentManager.removeContent(selectedContent, true);
      processed = true;
    }
  }

  if (!processed && contentManager != null) {
    final DataContext context = DataManager.getInstance().getDataContext(contentManager.getComponent());
    final ToolWindow tw = PlatformDataKeys.TOOL_WINDOW.getData(context);
    if (tw != null) {
      tw.hide(null);
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:20,代码来源:CloseActiveTabAction.java

示例3: clearConsoleToolWindow

import com.intellij.openapi.wm.ToolWindow; //导入方法依赖的package包/类
public static void clearConsoleToolWindow(@NotNull Project project) {
    final ToolWindowManager manager = ToolWindowManager.getInstance(project);
    ToolWindow toolWindow = manager.getToolWindow(toolWindowId);
    if (toolWindow == null) return;
    toolWindow.getContentManager().removeAllContents(false);
    toolWindow.hide(null);
}
 
开发者ID:internetisalie,项目名称:lua-for-idea,代码行数:8,代码来源:LuaSystemUtil.java

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

示例5: hideAllToolWindows

import com.intellij.openapi.wm.ToolWindow; //导入方法依赖的package包/类
private static boolean hideAllToolWindows(ToolWindowManagerEx manager) {
  // to clear windows stack
  manager.clearSideStack();

  String[] ids = manager.getToolWindowIds();
  boolean hasVisible = false;
  for (String id : ids) {
    final ToolWindow toolWindow = manager.getToolWindow(id);
    if (toolWindow.isVisible()) {
      toolWindow.hide(null);
      hasVisible = true;
    }
  }
  return hasVisible;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:16,代码来源:TogglePresentationModeAction.java

示例6: navigateToTask

import com.intellij.openapi.wm.ToolWindow; //导入方法依赖的package包/类
public static void navigateToTask(@NotNull Project project, @NotNull Task task) {
  for (VirtualFile file : FileEditorManager.getInstance(project).getOpenFiles()) {
    FileEditorManager.getInstance(project).closeFile(file);
  }
  Map<String, TaskFile> taskFiles = task.getTaskFiles();
  VirtualFile taskDir = task.getTaskDir(project);
  if (taskDir == null) {
    return;
  }
  VirtualFile srcDir = taskDir.findChild(EduNames.SRC);
  if (srcDir != null) {
    taskDir = srcDir;
  }
  if (taskFiles.isEmpty()) {
    ProjectView.getInstance(project).select(taskDir, taskDir, false);
    return;
  }
  VirtualFile fileToActivate = getFirstTaskFile(taskDir, project);
  for (Map.Entry<String, TaskFile> entry : taskFiles.entrySet()) {
    final TaskFile taskFile = entry.getValue();
    if (taskFile.getActivePlaceholders().isEmpty()) {
      continue;
    }
    VirtualFile virtualFile = taskDir.findFileByRelativePath(entry.getKey());
    if (virtualFile == null) {
      continue;
    }
    FileEditorManager.getInstance(project).openFile(virtualFile, true);
    fileToActivate = virtualFile;
  }
  EduUsagesCollector.taskNavigation();
  if (fileToActivate != null) {
    updateProjectView(project, fileToActivate);
  }

  StudyUtils.selectFirstAnswerPlaceholder(StudyUtils.getSelectedStudyEditor(project), project);
  ToolWindow runToolWindow = ToolWindowManager.getInstance(project).getToolWindow(ToolWindowId.RUN);
  if (runToolWindow != null) {
    runToolWindow.hide(null);
  }
}
 
开发者ID:medvector,项目名称:educational-plugin,代码行数:42,代码来源:StudyNavigator.java

示例7: hideTestResultsToolWindow

import com.intellij.openapi.wm.ToolWindow; //导入方法依赖的package包/类
public static void hideTestResultsToolWindow(@NotNull Project project) {
  ToolWindow toolWindow = ToolWindowManager.getInstance(project).getToolWindow(StudyTestResultsToolWindowFactoryKt.ID);
  if (toolWindow != null) {
    toolWindow.hide(() -> {});
  }
}
 
开发者ID:medvector,项目名称:educational-plugin,代码行数:7,代码来源:StudyCheckUtils.java

示例8: closeTabOrToolWindow

import com.intellij.openapi.wm.ToolWindow; //导入方法依赖的package包/类
private void closeTabOrToolWindow() {
  final JBList selectedList = getSelectedList();
  final int[] selected = selectedList.getSelectedIndices();
  Arrays.sort(selected);
  int selectedIndex = 0;
  for (int i = selected.length - 1; i >= 0; i--) {
    selectedIndex = selected[i];
    Object value = selectedList.getModel().getElementAt(selectedIndex);
    if (value instanceof FileInfo) {
      final FileInfo info = (FileInfo)value;
      final VirtualFile virtualFile = info.first;
      final FileEditorManagerImpl editorManager = (FileEditorManagerImpl)FileEditorManager.getInstance(project);
      final JList jList = getSelectedList();
      final EditorWindow wnd = findAppropriateWindow(info);
      if (wnd == null) {
        editorManager.closeFile(virtualFile, false, false);
      }
      else {
        editorManager.closeFile(virtualFile, wnd, false);
      }

      final IdeFocusManager focusManager = IdeFocusManager.getInstance(project);
      myAlarm.cancelAllRequests();
      myAlarm.addRequest(new Runnable() {
        @Override
        public void run() {
          JComponent focusTarget = selectedList;
          if (selectedList.getModel().getSize() == 0) {
            focusTarget = selectedList == files ? toolWindows : files;
          }
          focusManager.requestFocus(focusTarget, true);
        }
      }, 300);
      if (jList.getModel().getSize() == 1) {
        goLeft();
        removeElementAt(jList, selectedIndex);
        this.remove(jList);
        this.remove(separator);
        final Dimension size = toolWindows.getSize();
        myPopup.setSize(new Dimension(size.width, myPopup.getSize().height));
      }
      else {
        removeElementAt(jList, selectedIndex);
        jList.setSize(jList.getPreferredSize());
      }
      if (isPinnedMode()) {
        EditorHistoryManager.getInstance(project).removeFile(virtualFile);
      }
    }
    else if (value instanceof ToolWindow) {
      final ToolWindow toolWindow = (ToolWindow)value;
      if (twManager instanceof ToolWindowManagerImpl) {
        ToolWindowManagerImpl manager = (ToolWindowManagerImpl)twManager;
        manager.hideToolWindow(((ToolWindowImpl)toolWindow).getId(), false, false);
      }
      else {
        toolWindow.hide(null);
      }
    }
  }
  pack();
  myPopup.getContent().revalidate();
  myPopup.getContent().repaint();
  if (getSelectedList().getModel().getSize() > selectedIndex) {
    getSelectedList().setSelectedIndex(selectedIndex);
    getSelectedList().ensureIndexIsVisible(selectedIndex);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:69,代码来源:Switcher.java


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