本文整理汇总了Java中com.intellij.ui.content.ContentManagerEvent类的典型用法代码示例。如果您正苦于以下问题:Java ContentManagerEvent类的具体用法?Java ContentManagerEvent怎么用?Java ContentManagerEvent使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ContentManagerEvent类属于com.intellij.ui.content包,在下文中一共展示了ContentManagerEvent类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
}
});
}
示例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);
}
示例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);
}
}
});
}
}
示例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);
}
示例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);
}
});
}
示例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();
}
示例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));
}
}
示例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();
}
示例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();
}
示例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();
}
示例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);
}
示例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);
}
});
}
示例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();
}
示例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();
}
示例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);
}
}
}