• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java ContentManagerEvent类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: ToggleToolbarAction

import com.intellij.ui.content.ContentManagerEvent; //导入依赖的package包/类
private ToggleToolbarAction(@NotNull ToolWindow toolWindow, @NotNull PropertiesComponent propertiesComponent) {
  super("Show Toolbar");
  myPropertiesComponent = propertiesComponent;
  myToolWindow = toolWindow;
  myToolWindow.getContentManager().addContentManagerListener(new ContentManagerAdapter() {
    @Override
    public void contentAdded(ContentManagerEvent event) {
      JComponent component = event.getContent().getComponent();
      setContentToolbarVisible(component, getVisibilityValue());

      // support nested content managers, e.g. RunnerLayoutUi as content component
      ContentManager contentManager =
        component instanceof DataProvider ? PlatformDataKeys.CONTENT_MANAGER.getData((DataProvider)component) : null;
      if (contentManager != null) contentManager.addContentManagerListener(this);
    }
  });
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:18,代码来源:ToggleToolbarAction.java


示例2: registerToolWindowIfNeeded

import com.intellij.ui.content.ContentManagerEvent; //导入依赖的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


示例3: PanelWithActionsAndCloseButton

import com.intellij.ui.content.ContentManagerEvent; //导入依赖的package包/类
public PanelWithActionsAndCloseButton(ContentManager contentManager, @NonNls String helpId, final boolean verticalToolbar) {
  super(new BorderLayout());
  myContentManager = contentManager;
  myHelpId = helpId;
  myVerticalToolbar = verticalToolbar;
  myCloseEnabled = true;

  if (myContentManager != null) {
    myContentManager.addContentManagerListener(new ContentManagerAdapter(){
      public void contentRemoved(ContentManagerEvent event) {
        if (event.getContent().getComponent() == PanelWithActionsAndCloseButton.this) {
          dispose();
          myContentManager.removeContentManagerListener(this);
        }
      }
    });
  }

}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:20,代码来源:PanelWithActionsAndCloseButton.java


示例4: doAddLogConsole

import com.intellij.ui.content.ContentManagerEvent; //导入依赖的package包/类
private void doAddLogConsole(final LogConsoleBase log,
                             final String id,
                             Icon icon) {
  if (myEnvironment != null && myEnvironment.getRunProfile() instanceof RunConfigurationBase) {
    ((RunConfigurationBase)myEnvironment.getRunProfile()).customizeLogConsole(log);
  }
  log.attachStopLogConsoleTrackingListener(getProcessHandler());
  addAdditionalTabComponent(log, id, icon);

  getUi().addListener(new ContentManagerAdapter() {
    @Override
    public void selectionChanged(final ContentManagerEvent event) {
      log.activate();
    }
  }, log);
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:17,代码来源:LogConsoleManagerBase.java


示例5: ToggleToolbarAction

import com.intellij.ui.content.ContentManagerEvent; //导入依赖的package包/类
private ToggleToolbarAction(@Nonnull ToolWindow toolWindow, @Nonnull PropertiesComponent propertiesComponent) {
  super("Show Toolbar");
  myPropertiesComponent = propertiesComponent;
  myToolWindow = toolWindow;
  myToolWindow.getContentManager().addContentManagerListener(new ContentManagerAdapter() {
    @Override
    public void contentAdded(ContentManagerEvent event) {
      JComponent component = event.getContent().getComponent();
      setContentToolbarVisible(component, getVisibilityValue());

      // support nested content managers, e.g. RunnerLayoutUi as content component
      ContentManager contentManager =
              component instanceof DataProvider ? ((DataProvider)component).getDataUnchecked(PlatformDataKeys.CONTENT_MANAGER) : null;
      if (contentManager != null) contentManager.addContentManagerListener(this);
    }
  });
}
 
开发者ID:consulo,项目名称:consulo,代码行数:18,代码来源:ToggleToolbarAction.java


示例6: XDebugSessionTab

import com.intellij.ui.content.ContentManagerEvent; //导入依赖的package包/类
private XDebugSessionTab(@Nonnull XDebugSessionImpl session, @Nullable Icon icon, @Nullable ExecutionEnvironment environment) {
  super(session.getProject(), "Debug", session.getSessionName(), GlobalSearchScope.allScope(session.getProject()));

  setSession(session, environment, icon);

  myUi.addContent(createFramesContent(), 0, PlaceInGrid.left, false);
  addVariablesAndWatches(session);

  attachToSession(session);

  DefaultActionGroup focus = new DefaultActionGroup();
  focus.add(ActionManager.getInstance().getAction(XDebuggerActions.FOCUS_ON_BREAKPOINT));
  myUi.getOptions().setAdditionalFocusActions(focus);

  myUi.addListener(new ContentManagerAdapter() {
    @Override
    public void selectionChanged(ContentManagerEvent event) {
      Content content = event.getContent();
      if (mySession != null && content.isSelected() && getWatchesContentId().equals(ViewImpl.ID.get(content))) {
        myRebuildWatchesRunnable.run();
      }
    }
  }, myRunContentDescriptor);

  rebuildViews();
}
 
开发者ID:consulo,项目名称:consulo,代码行数:27,代码来源:XDebugSessionTab.java


示例7: init

import com.intellij.ui.content.ContentManagerEvent; //导入依赖的package包/类
@Override
public void init() {
  reset();

  myIdLabel = new BaseLabel(myUi, false) {
    @Override
    protected boolean allowEngravement() {
      return myUi.myWindow.isActive();
    }
  };
  for (int i = 0; i < myUi.myManager.getContentCount(); i++) {
    contentAdded(new ContentManagerEvent(this, myUi.myManager.getContent(i), i));
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:15,代码来源:TabContentLayout.java


示例8: contentAdded

import com.intellij.ui.content.ContentManagerEvent; //导入依赖的package包/类
@Override
public void contentAdded(ContentManagerEvent event) {
  final Content content = event.getContent();
  final ContentTabLabel tab;
  if (content instanceof TabbedContent) {
    tab = new TabbedContentTabLabel((TabbedContent)content, this);
  } else {
    tab = new ContentTabLabel(content, this);
  }
  myTabs.add(event.getIndex(), tab);
  myContent2Tabs.put(content, tab);
  
  myCached.clear();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:15,代码来源:TabContentLayout.java


示例9: contentRemoved

import com.intellij.ui.content.ContentManagerEvent; //导入依赖的package包/类
@Override
public void contentRemoved(ContentManagerEvent event) {
  final ContentTabLabel tab = myContent2Tabs.get(event.getContent());
  if (tab != null) {
    myTabs.remove(tab);
    myContent2Tabs.remove(event.getContent());
  }
  
  myCached.clear();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:11,代码来源:TabContentLayout.java


示例10: setupImpl

import com.intellij.ui.content.ContentManagerEvent; //导入依赖的package包/类
public synchronized void setupImpl(@NotNull ToolWindow toolWindow, final boolean loadPaneExtensions) {
  ApplicationManager.getApplication().assertIsDispatchThread();
  myActionGroup = new DefaultActionGroup();

  myAutoScrollFromSourceHandler.install();

  myContentManager = toolWindow.getContentManager();
  if (!ApplicationManager.getApplication().isUnitTestMode()) {
    toolWindow.setDefaultContentUiType(ToolWindowContentUiType.COMBO);
    ((ToolWindowEx)toolWindow).setAdditionalGearActions(myActionGroup);
    toolWindow.getComponent().putClientProperty(ToolWindowContentUi.HIDE_ID_LABEL, "true");
  }

  GuiUtils.replaceJSplitPaneWithIDEASplitter(myPanel);
  SwingUtilities.invokeLater(new Runnable() {
    @Override
    public void run() {
      splitterProportions.restoreSplitterProportions(myPanel);
    }
  });

  if (loadPaneExtensions) {
    ensurePanesLoaded();
  }
  isInitialized = true;
  doAddUninitializedPanes();

  myContentManager.addContentManagerListener(new ContentManagerAdapter() {
    @Override
    public void selectionChanged(ContentManagerEvent event) {
      if (event.getOperation() == ContentManagerEvent.ContentOperation.add) {
        viewSelectionChanged();
      }
    }
  });
  viewSelectionChanged();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:38,代码来源:ProjectViewImpl.java


示例11: doAddLogConsole

import com.intellij.ui.content.ContentManagerEvent; //导入依赖的package包/类
private void doAddLogConsole(@NotNull final LogConsoleBase log, String id,  Icon icon, @Nullable RunProfile runProfile) {
  if (runProfile instanceof RunConfigurationBase) {
    ((RunConfigurationBase)runProfile).customizeLogConsole(log);
  }
  log.attachStopLogConsoleTrackingListener(getProcessHandler());
  addAdditionalTabComponent(log, id, icon);

  getUi().addListener(new ContentManagerAdapter() {
    @Override
    public void selectionChanged(final ContentManagerEvent event) {
      log.activate();
    }
  }, log);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:15,代码来源:LogConsoleManagerBase.java


示例12: CvsTabbedWindow

import com.intellij.ui.content.ContentManagerEvent; //导入依赖的package包/类
public CvsTabbedWindow(Project project) {
  myProject = project;
  Disposer.register(project, this);
  ApplicationManager.getApplication().invokeLater(new Runnable() {
    @Override
    public void run() {
      final ToolWindow toolWindow = getToolWindow();
      final ContentManager contentManager = toolWindow.getContentManager();
      contentManager.addContentManagerListener(new ContentManagerAdapter() {
        public void contentRemoved(ContentManagerEvent event) {
          final JComponent component = event.getContent().getComponent();
          final JComponent removedComponent = component instanceof CvsTabbedWindowComponent ?
                                              ((CvsTabbedWindowComponent)component).getComponent() : component;
          if (removedComponent == myErrorsView) {
            myErrorsView.dispose();
            myErrorsView = null;
          }
          else if (myOutput != null && removedComponent == myOutput.getComponent()) {
            EditorFactory.getInstance().releaseEditor(myOutput);
            myOutput = null;
          }
        }
      });
      toolWindow.installWatcher(contentManager);
    }
  });
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:28,代码来源:CvsTabbedWindow.java


示例13: contentAdded

import com.intellij.ui.content.ContentManagerEvent; //导入依赖的package包/类
@Override
public void contentAdded(ContentManagerEvent event) {
  final ContentTabLabel tab = new ContentTabLabel(event.getContent(), this);
  myTabs.add(event.getIndex(), tab);
  myContent2Tabs.put(event.getContent(), tab);
  
  myCached.clear();
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:9,代码来源:TabContentLayout.java


示例14: contentRemoveQuery

import com.intellij.ui.content.ContentManagerEvent; //导入依赖的package包/类
@Override
public synchronized void contentRemoveQuery(ContentManagerEvent contentManagerEvent) {
    Entity entity = ((HasEntity)contentManagerEvent.getContent().getComponent()).getEntity();
    if(!edited.containsKey(entity))  {
        // not edited
        return;
    }
    if(!Boolean.TRUE.equals(edited.get(entity))) {
        // not dirty
        return;
    }
    if(closeContentsCanceled) {
        // dirty and canceled
        contentManagerEvent.consume();
        return;
    }
    switch (askUser()) {
        case Messages.YES:
            // approve
            return;

        case Messages.CANCEL:
            closeContentsCanceled = true;
    }
    // dirty and rejected or canceled
    contentManagerEvent.consume();
}
 
开发者ID:janotav,项目名称:ali-idea-plugin,代码行数:28,代码来源:EntityEditManager.java


示例15: contentAdded

import com.intellij.ui.content.ContentManagerEvent; //导入依赖的package包/类
@Override
public void contentAdded(ContentManagerEvent event) {
    if (devMotivePanel == null && event.getContent().getComponent() instanceof DevMotivePanel) {
        DevMotivePanel panel = (DevMotivePanel) event.getContent().getComponent();
        if (annotation.getFile().equals(panel.getFile())) {
            devMotivePanel = panel;
            devMotivePanel.addChangeListener(this);
        }
    }
}
 
开发者ID:janotav,项目名称:ali-idea-plugin,代码行数:11,代码来源:DevMotiveAnnotationGutter.java


示例16: contentRemoved

import com.intellij.ui.content.ContentManagerEvent; //导入依赖的package包/类
@Override
public void contentRemoved(ContentManagerEvent event) {
    if (devMotivePanel != null && devMotivePanel.equals(event.getContent().getComponent())) {
        releasePanel();
        updateAnnotations();
    }
}
 
开发者ID:janotav,项目名称:ali-idea-plugin,代码行数:8,代码来源:DevMotiveAnnotationGutter.java


示例17: contentRemoved

import com.intellij.ui.content.ContentManagerEvent; //导入依赖的package包/类
@Override
public void contentRemoved(ContentManagerEvent contentManagerEvent) {
    if(this.equals(contentManagerEvent.getContent().getComponent())) {
        contentManagerEvent.getContent().getManager().removeContentManagerListener(this);
        _unregister();
    }
}
 
开发者ID:janotav,项目名称:ali-idea-plugin,代码行数:8,代码来源:EntityDetail.java


示例18: contentRemoved

import com.intellij.ui.content.ContentManagerEvent; //导入依赖的package包/类
public void contentRemoved(ContentManagerEvent event) {
  if (event.getContent() == myContent) {
    myContentManager.removeContentManagerListener(this);
    AntBuildMessageView buildMessageView = myContent.getUserData(KEY);
    if (!myCloseAllowed) {
      buildMessageView.stopProcess();
    }
    ProjectManager.getInstance().removeProjectManagerListener(myProject, this);
    myContent.release();
    myContent = null;
    buildMessageView.myBuildFile = null;
    buildMessageView.myPlainTextView.dispose();
  }
}
 
开发者ID:consulo,项目名称:consulo-apache-ant,代码行数:15,代码来源:AntBuildMessageView.java


示例19: contentRemoveQuery

import com.intellij.ui.content.ContentManagerEvent; //导入依赖的package包/类
public void contentRemoveQuery(ContentManagerEvent event) {
  if (event.getContent() == myContent) {
    boolean canClose = closeQuery();
    if (!canClose) {
      event.consume();
    }
  }
}
 
开发者ID:consulo,项目名称:consulo-apache-ant,代码行数:9,代码来源:AntBuildMessageView.java


示例20: addContent

import com.intellij.ui.content.ContentManagerEvent; //导入依赖的package包/类
@Override
public void addContent(@Nonnull final Content content) {
  myContents.add(content);
  Disposer.register(this, content);
  ContentManagerEvent e = new ContentManagerEvent(this, content, myContents.indexOf(content), ContentManagerEvent.ContentOperation.add);
  myDispatcher.getMulticaster().contentAdded(e);
  if (mySelected == null) setSelectedContent(content);
}
 
开发者ID:consulo,项目名称:consulo,代码行数:9,代码来源:ToolWindowHeadlessManagerImpl.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java XmlAdapterDefinition类代码示例发布时间:2022-05-22
下一篇:
Java CollationKeyAnalyzer类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap