Example usage for com.intellij.openapi.wm ToolWindowId VCS

List of usage examples for com.intellij.openapi.wm ToolWindowId VCS

Introduction

In this page you can find the example usage for com.intellij.openapi.wm ToolWindowId VCS.

Prototype

String VCS

To view the source code for com.intellij.openapi.wm ToolWindowId VCS.

Click Source Link

Usage

From source file:org.community.intellij.plugins.communitycase.update.SkippedCommits.java

License:Apache License

/**
 * Show skipped commits/*from w ww .  j  a v a 2  s .co  m*/
 *
 * @param project        the context project
 * @param skippedCommits the skipped commits
 */
public static void showSkipped(final Project project,
        final SortedMap<VirtualFile, List<RebaseUtils.CommitInfo>> skippedCommits) {
    UIUtil.invokeLaterIfNeeded(new Runnable() {
        @Override
        public void run() {
            ContentManager contentManager = ProjectLevelVcsManagerEx.getInstanceEx(project).getContentManager();
            if (contentManager == null) {
                return;
            }
            SkippedCommits skipped = new SkippedCommits(contentManager, project, skippedCommits);
            Content content = ContentFactory.SERVICE.getInstance().createContent(skipped, "Skipped Commits",
                    true);
            ContentsUtil.addContent(contentManager, content, true);
            ToolWindowManager.getInstance(project).getToolWindow(ToolWindowId.VCS).activate(null);
        }
    });
}

From source file:org.jetbrains.idea.svn.actions.ShowSvnMapAction.java

License:Apache License

public void actionPerformed(final AnActionEvent e) {
    final Project project = e.getData(CommonDataKeys.PROJECT);
    if (project == null) {
        return;/*from  w w w .  ja va 2 s  .c  o  m*/
    }

    final CopiesPanel copiesPanel = new CopiesPanel(project);
    ToolWindow toolWindow = ToolWindowManager.getInstance(project).getToolWindow(ToolWindowId.VCS);
    final ContentManager contentManager = toolWindow.getContentManager();

    Content content = ContentFactory.SERVICE.getInstance().createContent(copiesPanel.getComponent(),
            SvnBundle.message("dialog.show.svn.map.title"), true);
    ContentsUtil.addOrReplaceContent(contentManager, content, true);
    toolWindow.activate(new Runnable() {
        public void run() {
            IdeFocusManager.getInstance(project).requestFocus(copiesPanel.getPreferredFocusedComponent(), true);
        }
    });
    /*SwingUtilities.invokeLater(new Runnable() {
      public void run() {
        IdeFocusManager.getInstance(project).requestFocus(copiesPanel.getPrefferedFocusComponent(), true);
      }
    });*/
}

From source file:org.jetbrains.idea.svn.dialogs.IntersectingLocalChangesPanel.java

License:Apache License

public static void showInVersionControlToolWindow(final Project project, final String title,
        final List<FilePath> filesToShow, final String prompt) {
    final IntersectingLocalChangesPanel component = new IntersectingLocalChangesPanel(project, filesToShow,
            prompt);//  www .j  a v  a  2  s .  c  o m

    ToolWindow toolWindow = ToolWindowManager.getInstance(project).getToolWindow(ToolWindowId.VCS);
    final ContentManager contentManager = toolWindow.getContentManager();

    Content content = ContentFactory.SERVICE.getInstance().createContent(component.getPanel(), title, true);
    ContentsUtil.addContent(contentManager, content, true);
    toolWindow.activate(new Runnable() {
        public void run() {
            IdeFocusManager.getInstance(project).requestFocus(component.getPrefferedFocusComponent(), true);
        }
    });

}

From source file:org.jetbrains.idea.svn.history.SvnMergeSourceDetails.java

License:Apache License

public static void showMe(final Project project, final SvnFileRevision revision, final VirtualFile file) {
    if (ModalityState.NON_MODAL.equals(ModalityState.current())) {
        ToolWindow toolWindow = ToolWindowManager.getInstance(project).getToolWindow(ToolWindowId.VCS);
        final ContentManager contentManager = toolWindow.getContentManager();

        final MyDialog dialog = new MyDialog(project, revision, file);

        Content content = ContentFactory.SERVICE.getInstance().createContent(dialog.createCenterPanel(),
                SvnBundle.message("merge.source.details.title",
                        (file == null) ? revision.getURL() : file.getName(),
                        revision.getRevisionNumber().asString()),
                true);/*from   w  w w  . j a v  a2  s .co m*/
        ContentsUtil.addOrReplaceContent(contentManager, content, true);

        toolWindow.activate(null);
    } else {
        new MyDialog(project, revision, file).show();
    }
}

From source file:org.zmlx.hg4idea.action.mq.HgShowUnAppliedPatchesAction.java

License:Apache License

public static void showUnAppliedPatches(@NotNull Project project, @NotNull HgRepository selectedRepo) {
    ToolWindow toolWindow = ObjectUtils//ww  w .j a  v a  2s.co m
            .assertNotNull(ToolWindowManager.getInstance(project).getToolWindow(ToolWindowId.VCS));
    ContentUtilEx.addTabbedContent(toolWindow.getContentManager(), new HgMqUnAppliedPatchesPanel(selectedRepo),
            "MQ", selectedRepo.getRoot().getName(), true);
    toolWindow.activate(null);
}