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


Java ContentManager.addContentManagerListener方法代码示例

本文整理汇总了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);
}
 
开发者ID:traff,项目名称:intellij-ocaml,代码行数:22,代码来源:OCamlToolWindowComponent.java

示例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();
}
 
开发者ID:janotav,项目名称:ali-idea-plugin,代码行数:26,代码来源:AliContentFactory.java

示例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;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:14,代码来源:RunnerLayoutUiImpl.java

示例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);
}
 
开发者ID:consulo,项目名称:consulo-apache-ant,代码行数:8,代码来源:AntBuildMessageView.java

示例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;
}
 
开发者ID:consulo,项目名称:consulo,代码行数:14,代码来源:RunnerLayoutUiImpl.java

示例6: setContent

import com.intellij.ui.content.ContentManager; //导入方法依赖的package包/类
public void setContent(Content content, ContentManager contentManager) {
  myContent = content;
  myContentManager = contentManager;
  contentManager.addContentManagerListener(this);
}
 
开发者ID:consulo,项目名称:consulo,代码行数:6,代码来源:CompilerTask.java


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