本文整理汇总了Java中com.intellij.ui.content.ContentManager.addContentManagerListener方法的典型用法代码示例。如果您正苦于以下问题:Java ContentManager.addContentManagerListener方法的具体用法?Java ContentManager.addContentManagerListener怎么用?Java ContentManager.addContentManagerListener使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.ui.content.ContentManager
的用法示例。
在下文中一共展示了ContentManager.addContentManagerListener方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: registerToolWindowIfNeeded
import com.intellij.ui.content.ContentManager; //导入方法依赖的package包/类
private void registerToolWindowIfNeeded() {
if (myToolWindowWasRegistered || !toolWindowShouldBeRegistered()) return;
final ToolWindow toolWindow = myToolWindowManager.registerToolWindow(TOOL_WINDOW_ID, true, ToolWindowAnchor.BOTTOM, false);
toolWindow.setIcon(OCamlIconUtil.getSmallOCamlIcon());
toolWindow.setTitle(TOOL_WINDOW_ID);
myToolWindowWasRegistered = true;
final ContentManager contentManager = toolWindow.getContentManager();
contentManager.addContentManagerListener(new ContentManagerAdapter() {
@Override
public void contentRemoved(@NotNull final ContentManagerEvent event) {
if (contentManager.getContentCount() == 0) {
OCamlToolWindowUtil.addAndSelectStartContent(myProject, contentManager);
}
}
});
OCamlToolWindowUtil.addAndSelectStartContent(myProject, contentManager);
}
示例2: addDevMotiveContent
import com.intellij.ui.content.ContentManager; //导入方法依赖的package包/类
public static DevMotivePanel addDevMotiveContent(Project project, VirtualFile file, List<VcsFileRevision> revisions, String vcsName, ContentManagerListener listener, boolean select) {
ApplicationManager.getApplication().assertIsDispatchThread();
ToolWindowManager toolWindowManager = project.getComponent(ToolWindowManager.class);
ToolWindow toolWindow = toolWindowManager.getToolWindow(TOOL_WINDOW_MAIN);
ContentManager contentManager = toolWindow.getContentManager();
Content content = findDevMotiveContent(toolWindow, file);
if (content == null) {
contentManager = toolWindow.getContentManager();
int idx = contentManager.getContentCount();
DevMotivePanel devMotivePanel = new DevMotivePanel(project, file, revisions, vcsName);
content = ContentFactory.SERVICE.getInstance().createContent(devMotivePanel, devMotivePanel.getName(), false);
contentManager.addContent(content, idx);
} else if (revisions != null) {
((DevMotive) content.getComponent()).load(revisions);
}
if (select) {
contentManager.setSelectedContent(content);
}
if (listener != null) {
contentManager.addContentManagerListener(listener);
}
return (DevMotivePanel) content.getComponent();
}
示例3: addListener
import com.intellij.ui.content.ContentManager; //导入方法依赖的package包/类
@NotNull
@Override
public RunnerLayoutUi addListener(@NotNull final ContentManagerListener listener, @NotNull final Disposable parent) {
final ContentManager mgr = getContentManager();
mgr.addContentManagerListener(listener);
Disposer.register(parent, new Disposable() {
@Override
public void dispose() {
mgr.removeContentManagerListener(listener);
}
});
return this;
}
示例4: CloseListener
import com.intellij.ui.content.ContentManager; //导入方法依赖的package包/类
private CloseListener(Content content, ContentManager contentManager, Project project) {
myContent = content;
myContentManager = contentManager;
myProject = project;
contentManager.addContentManagerListener(this);
ProjectManager.getInstance().addProjectManagerListener(myProject, this);
}
示例5: addListener
import com.intellij.ui.content.ContentManager; //导入方法依赖的package包/类
@Nonnull
@Override
public RunnerLayoutUi addListener(@Nonnull final ContentManagerListener listener, @Nonnull final Disposable parent) {
final ContentManager mgr = getContentManager();
mgr.addContentManagerListener(listener);
Disposer.register(parent, new Disposable() {
@Override
public void dispose() {
mgr.removeContentManagerListener(listener);
}
});
return this;
}
示例6: setContent
import com.intellij.ui.content.ContentManager; //导入方法依赖的package包/类
public void setContent(Content content, ContentManager contentManager) {
myContent = content;
myContentManager = contentManager;
contentManager.addContentManagerListener(this);
}