本文整理汇总了Java中com.intellij.ui.content.ContentManager.removeAllContents方法的典型用法代码示例。如果您正苦于以下问题:Java ContentManager.removeAllContents方法的具体用法?Java ContentManager.removeAllContents怎么用?Java ContentManager.removeAllContents使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.ui.content.ContentManager
的用法示例。
在下文中一共展示了ContentManager.removeAllContents方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: updateToolWindow
import com.intellij.ui.content.ContentManager; //导入方法依赖的package包/类
private void updateToolWindow(@NotNull Project project, @NotNull ToolWindow toolWindow) {
ContentManager contentManager = toolWindow.getContentManager();
contentManager.removeAllContents(true);
FileEditorManager fileEditorManager = FileEditorManager.getInstance(project);
Editor selectedEditor = fileEditorManager.getSelectedTextEditor();
if (selectedEditor == null) return;
PsiFile psiFile = PsiDocumentManager.getInstance(project).getPsiFile(selectedEditor.getDocument());
if (psiFile == null || !psiFile.getLanguage().equals(PythonLanguage.INSTANCE)) {
return;
}
FileEditor fileEditor = fileEditorManager.getSelectedEditor(psiFile.getVirtualFile());
StructureView structureView = new PTestStructureViewFactory().getStructureViewBuilder(psiFile).createStructureView(fileEditor, project);
Content content = ContentFactory.SERVICE.getInstance().createContent(structureView.getComponent(), "", false);
contentManager.addContent(content);
}
示例2: updateContent
import com.intellij.ui.content.ContentManager; //导入方法依赖的package包/类
private void updateContent(ToolWindow toolWindow, String projectName)
{
toolWindow.setIcon(Icons.LOGO);
ContentManager contentManager = toolWindow.getContentManager();
contentManager.removeAllContents(true);
Content content = contentManager.getFactory()
.createContent(createContent(), "[" + projectName + "]", false);
contentManager.addContent(content);
}
示例3: resetContent
import com.intellij.ui.content.ContentManager; //导入方法依赖的package包/类
private void resetContent(Project project) {
DrawableViewer drawableViewer = new DrawableViewer(project);
ContentManager contentManager = ToolWindowManager.getInstance(project)
.getToolWindow(Constants.TOOL_WINDOW_ID).getContentManager();
Content content = contentManager.getFactory().createContent(drawableViewer, null, false);
contentManager.removeAllContents(true);
contentManager.addContent(content);
}