本文整理汇总了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);
}
});
}
示例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);
}
});*/
}
示例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);
}
});
}
示例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();
}
}
示例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;
}
示例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);
}
});*/
}
示例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();
}
}
示例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);
}
}
}
}
示例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);
}
}
}
}