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


Java ToolWindow.isVisible方法代码示例

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


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

import com.intellij.openapi.wm.ToolWindow; //导入方法依赖的package包/类
private ToolWindowManagerListener createToolWindowListener() {
    return new ToolWindowManagerListener() {
        @Override
        public void toolWindowRegistered(@NotNull String s) {
            Log.d("DebuggerComponent.toolWindowRegistered");
        }

        @Override
        public void stateChanged() {
            ToolWindow toolWindow = ToolWindowManager.getInstance(mProject).getToolWindow(DebuggerToolWindowFactory.TOOL_WINDOW_ID);
            if (toolWindow != null) {
                if (toolWindow.isVisible() && toolWindow.getContentManager().getContentCount() == 0) {
                    Log.d("DebuggerComponent.isVisible ContentCount>0");
                    initApiDebugger(toolWindow);
                }
            }
        }
    };
}
 
开发者ID:FingerArt,项目名称:ApiDebugger,代码行数:20,代码来源:DebuggerComponent.java

示例3: activateView

import com.intellij.openapi.wm.ToolWindow; //导入方法依赖的package包/类
public void activateView(final ShelvedChangeList list) {
  Runnable runnable = new Runnable() {
    public void run() {
      if (list != null) {
        TreeUtil.selectNode(myTree, TreeUtil.findNodeWithObject(myRoot, list));
      }
      myContentManager.setSelectedContent(myContent);
      ToolWindow window = ToolWindowManager.getInstance(myProject).getToolWindow(ChangesViewContentManager.TOOLWINDOW_ID);
      if (!window.isVisible()) {
        window.activate(null);
      }
    }
  };
  if (myUpdatePending) {
    myPostUpdateRunnable = runnable;
  }
  else {
    runnable.run();
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:21,代码来源:ShelvedChangesViewManager.java

示例4: findRunningConsole

import com.intellij.openapi.wm.ToolWindow; //导入方法依赖的package包/类
public static Collection<RunContentDescriptor> findRunningConsole(@NotNull Project project,
                                                                  @NotNull NotNullFunction<RunContentDescriptor, Boolean> descriptorMatcher) {
  RunContentManager contentManager = ExecutionManager.getInstance(project).getContentManager();
  final RunContentDescriptor selectedContent = contentManager.getSelectedContent();
  if (selectedContent != null) {
    final ToolWindow toolWindow = contentManager.getToolWindowByDescriptor(selectedContent);
    if (toolWindow != null && toolWindow.isVisible()) {
      if (descriptorMatcher.fun(selectedContent)) {
        return Collections.singletonList(selectedContent);
      }
    }
  }

  final ArrayList<RunContentDescriptor> result = ContainerUtil.newArrayList();
  for (RunContentDescriptor runContentDescriptor : contentManager.getAllDescriptors()) {
    if (descriptorMatcher.fun(runContentDescriptor)) {
      result.add(runContentDescriptor);
    }
  }
  return result;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:22,代码来源:ExecutionHelper.java

示例5: rootsChanged

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

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

示例7: isToolwindowVisible

import com.intellij.openapi.wm.ToolWindow; //导入方法依赖的package包/类
protected static boolean isToolwindowVisible(@NotNull JComponent splitters, @NotNull String toolwindowId) {
  Window frame = SwingUtilities.getWindowAncestor(splitters);
  if (frame instanceof IdeFrameImpl) {
    Project project = ((IdeFrameImpl)frame).getProject();
    if (project != null) {
      if (!project.isInitialized()) return true;
      ToolWindow toolWindow = ToolWindowManager.getInstance(project).getToolWindow(toolwindowId);
      return toolWindow != null && toolWindow.isVisible();
    }
  }
  return false;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:13,代码来源:EditorEmptyTextPainter.java

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

示例9: ancestorAdded

import com.intellij.openapi.wm.ToolWindow; //导入方法依赖的package包/类
@Override
public void ancestorAdded(AncestorEvent event) {
  ToolWindow log = EventLog.getEventLog(myProject);
  if (log != null && log.isVisible()) {
    EventLog.getLogModel(myProject).logShown();
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:8,代码来源:EventLogToolWindowFactory.java

示例10: openCommittedChangesTab

import com.intellij.openapi.wm.ToolWindow; //导入方法依赖的package包/类
public void openCommittedChangesTab(final CommittedChangesProvider provider,
                                    final RepositoryLocation location,
                                    final ChangeBrowserSettings settings,
                                    final int maxCount,
                                    String title) {
  DefaultActionGroup extraActions = new DefaultActionGroup();
  CommittedChangesPanel panel = new CommittedChangesPanel(myProject, provider, settings, location, extraActions);
  panel.setMaxCount(maxCount);
  panel.refreshChanges(false);
  final ContentFactory factory = ContentFactory.SERVICE.getInstance();
  if (title == null && location != null) {
    title = VcsBundle.message("browse.changes.content.title", location.toPresentableString());
  }
  final Content content = factory.createContent(panel, title, false);
  final ChangesViewContentI contentManager = ChangesViewContentManager.getInstance(myProject);
  contentManager.addContent(content);
  contentManager.setSelectedContent(content);

  extraActions.add(new CloseTabToolbarAction() {
    public void actionPerformed(final AnActionEvent e) {
      contentManager.removeContent(content);
    }
  });

  ToolWindow window = ToolWindowManager.getInstance(myProject).getToolWindow(ChangesViewContentManager.TOOLWINDOW_ID);
  if (!window.isVisible()) {
    window.activate(null);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:30,代码来源:AbstractVcsHelperImpl.java

示例11: actionPerformed

import com.intellij.openapi.wm.ToolWindow; //导入方法依赖的package包/类
public void actionPerformed(AnActionEvent e) {
  final Project project = e.getData(CommonDataKeys.PROJECT);
  if (project == null) return;
  if (! ProjectLevelVcsManager.getInstance(project).hasActiveVcss()) return;
  Change[] changes = e.getData(VcsDataKeys.CHANGES);
  List<VirtualFile> unversionedFiles = e.getData(ChangesListView.UNVERSIONED_FILES_DATA_KEY);

  final List<VirtualFile> changedFiles = new ArrayList<VirtualFile>();
  boolean activateChangesView = false;
  unversionedFiles = new ArrayList<VirtualFile>();
  final List<Change> changesList = new ArrayList<Change>();
  if (changes != null) {
    changesList.addAll(Arrays.asList(changes));
  } else {
    changes = new Change[0];
  }
  changesList.addAll(getChangesForSelectedFiles(project, unversionedFiles, changedFiles, e));
  activateChangesView = true;

  if (changesList.isEmpty() && unversionedFiles.isEmpty()) {
    VcsBalloonProblemNotifier.showOverChangesView(project, "Nothing is selected that can be moved", MessageType.INFO);
    return;
  }

  if (!askAndMove(project, changesList, unversionedFiles)) return;
  if (activateChangesView) {
    ToolWindow window = ToolWindowManager.getInstance(project).getToolWindow(ChangesViewContentManager.TOOLWINDOW_ID);
    if (!window.isVisible()) {
      window.activate(new Runnable() {
        public void run() {
          if (changedFiles.size() > 0) {
            ChangesViewManager.getInstance(project).selectFile(changedFiles.get(0));
          }
        }
      });
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:39,代码来源:MoveChangesToAnotherListAction.java

示例12: update

import com.intellij.openapi.wm.ToolWindow; //导入方法依赖的package包/类
@Override
public void update(AnActionEvent event) {
  super.update(event);
  if (event.getData(LangDataKeys.IDE_VIEW) == null) {
    Project project = event.getData(CommonDataKeys.PROJECT);
    PsiFile psiFile = event.getData(CommonDataKeys.PSI_FILE);
    if (project != null && psiFile != null) {
      final ToolWindow projectViewWindow = ToolWindowManager.getInstance(project).getToolWindow(ToolWindowId.PROJECT_VIEW);
      if (projectViewWindow.isVisible()) {
        event.getPresentation().setEnabled(true);
      }
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:15,代码来源:NewElementToolbarAction.java

示例13: findResizerAndComponent

import com.intellij.openapi.wm.ToolWindow; //导入方法依赖的package包/类
@Nullable
private Pair<Resizer, Component> findResizerAndComponent(ToolWindow wnd) {
  if (!wnd.isVisible()) return null;

  Resizer resizer = null;
  Component cmp = null;

  if (wnd.getType() == ToolWindowType.DOCKED) {
    cmp = getComponentAt(wnd.getAnchor());

    if (cmp != null) {
      if (wnd.getAnchor().isHorizontal()) {
        resizer = myVerticalSplitter.getFirstComponent() == cmp
                  ? new Resizer.Splitter.FirstComponent(myVerticalSplitter)
                  : new Resizer.Splitter.LastComponent(myVerticalSplitter);
      }
      else {
        resizer = myHorizontalSplitter.getFirstComponent() == cmp
                  ? new Resizer.Splitter.FirstComponent(myHorizontalSplitter)
                  : new Resizer.Splitter.LastComponent(myHorizontalSplitter);
      }
    }
  }
  else if (wnd.getType() == ToolWindowType.SLIDING) {
    cmp = wnd.getComponent();
    while (cmp != null) {
      if (cmp.getParent() == myLayeredPane) break;
      cmp = cmp.getParent();
    }

    if (cmp != null) {
      if (wnd.getAnchor() == ToolWindowAnchor.TOP) {
        resizer = new Resizer.LayeredPane.Top(cmp);
      }
      else if (wnd.getAnchor() == ToolWindowAnchor.BOTTOM) {
        resizer = new Resizer.LayeredPane.Bottom(cmp);
      }
      else if (wnd.getAnchor() == ToolWindowAnchor.LEFT) {
        resizer = new Resizer.LayeredPane.Left(cmp);
      }
      else if (wnd.getAnchor() == ToolWindowAnchor.RIGHT) {
        resizer = new Resizer.LayeredPane.Right(cmp);
      }
    }
  }

  return resizer != null ? Pair.create(resizer, cmp) : null;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:49,代码来源:ToolWindowsPane.java

示例14: shouldBeHiddenByShortCut

import com.intellij.openapi.wm.ToolWindow; //导入方法依赖的package包/类
static boolean shouldBeHiddenByShortCut(@NotNull ToolWindowManagerEx manager, @Nullable String id) {
  if (id == null) return false;
  ToolWindow window = manager.getToolWindow(id);
  return window.isVisible() && window.getType() != ToolWindowType.WINDOWED;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:6,代码来源:HideToolWindowAction.java

示例15: isStructureViewShowing

import com.intellij.openapi.wm.ToolWindow; //导入方法依赖的package包/类
protected boolean isStructureViewShowing() {
  ToolWindowManager windowManager = ToolWindowManager.getInstance(myProject);
  ToolWindow toolWindow = windowManager.getToolWindow(ToolWindowId.STRUCTURE_VIEW);
  // it means that window is registered
  return toolWindow != null && toolWindow.isVisible();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:7,代码来源:StructureViewWrapperImpl.java


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