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


Java ContentsUtil类代码示例

本文整理汇总了Java中com.intellij.util.ContentsUtil的典型用法代码示例。如果您正苦于以下问题:Java ContentsUtil类的具体用法?Java ContentsUtil怎么用?Java ContentsUtil使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: showSkipped

import com.intellij.util.ContentsUtil; //导入依赖的package包/类
/**
 * Show skipped commits
 *
 * @param project        the context project
 * @param skippedCommits the skipped commits
 */
public static void showSkipped(final Project project, final SortedMap<VirtualFile, List<GitRebaseUtils.CommitInfo>> skippedCommits) {
  UIUtil.invokeLaterIfNeeded(new Runnable() {
    @Override
    public void run() {
      ContentManager contentManager = ProjectLevelVcsManagerEx.getInstanceEx(project).getContentManager();
      if (contentManager == null) {
        return;
      }
      GitSkippedCommits skipped = new GitSkippedCommits(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);
    }
  });
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:22,代码来源:GitSkippedCommits.java

示例2: actionPerformed

import com.intellij.util.ContentsUtil; //导入依赖的package包/类
public void actionPerformed(final AnActionEvent e) {
  final Project project = e.getData(CommonDataKeys.PROJECT);
  if (project == null) {
    return;
  }

  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);
    }
  });*/
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:24,代码来源:ShowSvnMapAction.java

示例3: showInVersionControlToolWindow

import com.intellij.util.ContentsUtil; //导入依赖的package包/类
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);

  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);
    }
  });

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

示例4: showMe

import com.intellij.util.ContentsUtil; //导入依赖的package包/类
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);
  // TODO: Temporary memory leak fix - rewrite this part not to create dialog if only createCenterPanel(), but not show() is invoked
  Disposer.register(project, dialog.getDisposable());

  Content content = ContentFactory.SERVICE.getInstance().createContent(dialog.createCenterPanel(),
      SvnBundle.message("merge.source.details.title", (file == null) ? revision.getURL() : file.getName(), revision.getRevisionNumber().asString()), true);
  ContentsUtil.addOrReplaceContent(contentManager, content, true);

  toolWindow.activate(null);
  } else {
    new MyDialog(project, revision, file).show();
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:19,代码来源:SvnMergeSourceDetails.java

示例5: showUpdateProjectInfo

import com.intellij.util.ContentsUtil; //导入依赖的package包/类
public UpdateInfoTree showUpdateProjectInfo(UpdatedFiles updatedFiles, String displayActionName, ActionInfo actionInfo, boolean canceled) {
  if (! myProject.isOpen() || myProject.isDisposed()) return null;
  ContentManager contentManager = getContentManager();
  if (contentManager == null) {
    return null;  // content manager is made null during dispose; flag is set later
  }
  final UpdateInfoTree updateInfoTree = new UpdateInfoTree(contentManager, myProject, updatedFiles, displayActionName, actionInfo);
  Content content = ContentFactory.SERVICE.getInstance().createContent(updateInfoTree, canceled ?
    VcsBundle.message("toolwindow.title.update.action.canceled.info", displayActionName) :
    VcsBundle.message("toolwindow.title.update.action.info", displayActionName), true);
  Disposer.register(content, updateInfoTree);
  ContentsUtil.addContent(contentManager, content, true);
  ToolWindowManager.getInstance(myProject).getToolWindow(ToolWindowId.VCS).activate(null);
  updateInfoTree.expandRootChildren();
  return updateInfoTree;
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:17,代码来源:ProjectLevelVcsManagerImpl.java

示例6: actionPerformed

import com.intellij.util.ContentsUtil; //导入依赖的package包/类
public void actionPerformed(final AnActionEvent e) {
  final Project project = e.getData(PlatformDataKeys.PROJECT);
  if (project == null) {
    return;
  }

  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);
    }
  });*/
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:24,代码来源:ShowSvnMapAction.java

示例7: showMe

import com.intellij.util.ContentsUtil; //导入依赖的package包/类
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);
  ContentsUtil.addOrReplaceContent(contentManager, content, true);

  toolWindow.activate(null);
  } else {
    new MyDialog(project, revision, file).show();
  }
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:17,代码来源:SvnMergeSourceDetails.java

示例8: actionPerformed

import com.intellij.util.ContentsUtil; //导入依赖的package包/类
public void actionPerformed(AnActionEvent e) {
  if (myContentManager != null) {
    Content content = myContentManager.getContent(PanelWithActionsAndCloseButton.this);
    if (content != null) {
      ContentsUtil.closeContentTab(myContentManager, content);
      if (content instanceof TabbedContent && ((TabbedContent)content).getTabs().size() > 1) {
        final TabbedContent tabbedContent = (TabbedContent)content;
        final JComponent component = content.getComponent();
        tabbedContent.removeContent(component);
        myContentManager.setSelectedContent(content, true, true); //we should request focus here
      } else {
        myContentManager.removeContent(content, true);
      }
    }
  }
}
 
开发者ID:consulo,项目名称:consulo,代码行数:17,代码来源:PanelWithActionsAndCloseButton.java

示例9: closeLogTabs

import com.intellij.util.ContentsUtil; //导入依赖的package包/类
private void closeLogTabs() {
  ToolWindow toolWindow = ToolWindowManager.getInstance(myProject).getToolWindow(ToolWindowId.VCS);

  if (toolWindow != null) {
    for (Content content : toolWindow.getContentManager().getContents()) {
      if (ContentUtilEx.isContentTab(content, TAB_NAME)) {
        ContentsUtil.closeContentTab(toolWindow.getContentManager(), content);
      }
    }
  }
}
 
开发者ID:consulo,项目名称:consulo,代码行数:12,代码来源:VcsLogContentProvider.java


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