本文整理汇总了Java中com.intellij.openapi.wm.ToolWindow.getContentManager方法的典型用法代码示例。如果您正苦于以下问题:Java ToolWindow.getContentManager方法的具体用法?Java ToolWindow.getContentManager怎么用?Java ToolWindow.getContentManager使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.openapi.wm.ToolWindow
的用法示例。
在下文中一共展示了ToolWindow.getContentManager方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createToolWindowContent
import com.intellij.openapi.wm.ToolWindow; //导入方法依赖的package包/类
@Override
public void createToolWindowContent(@NotNull final Project project, @NotNull final ToolWindow toolWindow) {
toolWindow.setIcon(EducationalCoreIcons.TaskDescription);
final Course course = StudyTaskManager.getInstance(project).getCourse();
if (course != null) {
final StudyToolWindow studyToolWindow;
if (StudyUtils.hasJavaFx() && StudySettings.getInstance().shouldUseJavaFx()) {
studyToolWindow = new StudyJavaFxToolWindow();
}
else {
studyToolWindow = new StudySwingToolWindow();
}
studyToolWindow.init(project, true);
final ContentManager contentManager = toolWindow.getContentManager();
final Content content = contentManager.getFactory().createContent(studyToolWindow, null, false);
contentManager.addContent(content);
Disposer.register(project, studyToolWindow);
}
}
示例2: getContentManager
import com.intellij.openapi.wm.ToolWindow; //导入方法依赖的package包/类
private ContentManager getContentManager(boolean dataFlowToThis) {
if (dataFlowToThis) {
if (myBackContentManager == null) {
ToolWindow backToolWindow = ToolWindowManager.getInstance(myProject).registerToolWindow(BACK_TOOLWINDOW_ID, true, ToolWindowAnchor.BOTTOM, myProject);
myBackContentManager = backToolWindow.getContentManager();
new ContentManagerWatcher(backToolWindow, myBackContentManager);
}
return myBackContentManager;
}
if (myForthContentManager == null) {
ToolWindow forthToolWindow = ToolWindowManager.getInstance(myProject).registerToolWindow(FORTH_TOOLWINDOW_ID, true, ToolWindowAnchor.BOTTOM, myProject);
myForthContentManager = forthToolWindow.getContentManager();
new ContentManagerWatcher(forthToolWindow, myForthContentManager);
}
return myForthContentManager;
}
示例3: showMe
import com.intellij.openapi.wm.ToolWindow; //导入方法依赖的package包/类
public static void showMe(final Project project, final SvnFileRevision revision, final VirtualFile file) {
if (ModalityState.NON_MODAL.equals(ModalityState.current())) {
ToolWindow toolWindow = ToolWindowManager.getInstance(project).getToolWindow(ToolWindowId.VCS);
final ContentManager contentManager = toolWindow.getContentManager();
final MyDialog dialog = new MyDialog(project, revision, file);
// TODO: Temporary memory leak fix - rewrite this part not to create dialog if only createCenterPanel(), but not show() is invoked
Disposer.register(project, dialog.getDisposable());
Content content = ContentFactory.SERVICE.getInstance().createContent(dialog.createCenterPanel(),
SvnBundle.message("merge.source.details.title", (file == null) ? revision.getURL() : file.getName(), revision.getRevisionNumber().asString()), true);
ContentsUtil.addOrReplaceContent(contentManager, content, true);
toolWindow.activate(null);
} else {
new MyDialog(project, revision, file).show();
}
}
示例4: actionPerformed
import com.intellij.openapi.wm.ToolWindow; //导入方法依赖的package包/类
public void actionPerformed(final AnActionEvent e) {
final Project project = e.getData(CommonDataKeys.PROJECT);
if (project == null) {
return;
}
final CopiesPanel copiesPanel = new CopiesPanel(project);
ToolWindow toolWindow = ToolWindowManager.getInstance(project).getToolWindow(ToolWindowId.VCS);
final ContentManager contentManager = toolWindow.getContentManager();
Content content = ContentFactory.SERVICE.getInstance().createContent(copiesPanel.getComponent(), SvnBundle.message("dialog.show.svn.map.title"), true);
ContentsUtil.addOrReplaceContent(contentManager, content, true);
toolWindow.activate(new Runnable() {
public void run() {
IdeFocusManager.getInstance(project).requestFocus(copiesPanel.getPreferredFocusedComponent(), true);
}
});
/*SwingUtilities.invokeLater(new Runnable() {
public void run() {
IdeFocusManager.getInstance(project).requestFocus(copiesPanel.getPrefferedFocusComponent(), true);
}
});*/
}
示例5: showInVersionControlToolWindow
import com.intellij.openapi.wm.ToolWindow; //导入方法依赖的package包/类
public static void showInVersionControlToolWindow(final Project project, final String title, final List<FilePath> filesToShow,
final String prompt) {
final IntersectingLocalChangesPanel component = new IntersectingLocalChangesPanel(project, filesToShow, prompt);
ToolWindow toolWindow = ToolWindowManager.getInstance(project).getToolWindow(ToolWindowId.VCS);
final ContentManager contentManager = toolWindow.getContentManager();
Content content = ContentFactory
.SERVICE.getInstance().createContent(component.getPanel(), title, true);
ContentsUtil.addContent(contentManager, content, true);
toolWindow.activate(new Runnable() {
public void run() {
IdeFocusManager.getInstance(project).requestFocus(component.getPrefferedFocusComponent(), true);
}
});
}
示例6: focusGained
import com.intellij.openapi.wm.ToolWindow; //导入方法依赖的package包/类
@Override
public void focusGained(FocusEvent e) {
ToolWindow toolWindow = ToolWindowManager.getInstance(myProject).getToolWindow(RNToolWindowFactory.TOOL_WINDOW_ID);
if (toolWindow != null) {
try {
ContentManager contentManager = toolWindow.getContentManager();
JComponent component = contentManager.getSelectedContent().getComponent();
if (component != null) {
component.requestFocusInWindow();
}
} catch (Exception e1) {
e1.printStackTrace();
}
}
}
示例7: updateContent
import com.intellij.openapi.wm.ToolWindow; //导入方法依赖的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);
}
示例8: closeTab
import com.intellij.openapi.wm.ToolWindow; //导入方法依赖的package包/类
public void closeTab(@NotNull final BaseFrameController frame) {
final ToolWindow toolWindow = getToolWindow();
final ContentManager toolwindowCM = toolWindow.getContentManager();
// NOTE the dispose: true parameter here will only dispose the content (the JPanel) but not the controller!
toolwindowCM.removeContent(toolwindowCM.getContent(frame.getControlPanel()), true);
Disposer.dispose(frame);
}
示例9: openTab
import com.intellij.openapi.wm.ToolWindow; //导入方法依赖的package包/类
private void openTab(final BaseFrameController controller, String tabTitle) {
ApplicationManager.getApplication().assertIsDispatchThread();
final ToolWindow toolWindow = getToolWindow();
final ContentManager toolwindowCM = toolWindow.getContentManager();
final ContentFactory contentFactory = ContentFactory.SERVICE.getInstance();
// clean up previous tab
boolean toolWindowOpen = currentFrame == null;
if (currentFrame != null) {
toolwindowCM.removeContent(toolwindowCM.getContent(currentFrame.getControlPanel()), true);
Disposer.dispose(currentFrame);
}
// add new content
currentFrame = controller;
Content newToolWindowTab = contentFactory.createContent(currentFrame.getControlPanel(), tabTitle, false);
toolwindowCM.addContent(newToolWindowTab);
toolwindowCM.setSelectedContent(newToolWindowTab);
// make sure the toolwindow is visible
toolWindow.show(new Runnable() {
@Override
public void run() {
JComponent view = (JComponent) currentFrame.view;
view.revalidate();
view.repaint();
TrackingService.trace(IdeaRawEvent.toolWindowShowContent(project, controller));
}
});
}
示例10: createToolWindowContent
import com.intellij.openapi.wm.ToolWindow; //导入方法依赖的package包/类
@Override
public void createToolWindowContent(@NotNull final Project project, @NotNull final ToolWindow toolWindow) {
toolWindow.setTitle(myExternalSystemId.getReadableName());
ContentManager contentManager = toolWindow.getContentManager();
final ExternalProjectsViewImpl projectsView = new ExternalProjectsViewImpl(project, (ToolWindowEx)toolWindow, myExternalSystemId);
ExternalProjectsManager.getInstance(project).registerView(projectsView);
ContentImpl tasksContent = new ContentImpl(projectsView, ExternalSystemBundle.message("tool.window.title.projects"), true);
contentManager.addContent(tasksContent);
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:10,代码来源:AbstractExternalSystemToolWindowFactory.java
示例11: getContextContent
import com.intellij.openapi.wm.ToolWindow; //导入方法依赖的package包/类
@Nullable
private static Content getContextContent(@NotNull AnActionEvent event) {
final ToolWindow window = PlatformDataKeys.TOOL_WINDOW.getData(event.getDataContext());
if (window != null) {
final ContentManager contentManager = window.getContentManager();
if (contentManager != null) {
return contentManager.getSelectedContent();
}
}
return null;
}
示例12: createContent
import com.intellij.openapi.wm.ToolWindow; //导入方法依赖的package包/类
static void createContent(Project project, ToolWindow toolWindow, EventLogConsole console, String title) {
// update default Event Log tab title
ContentManager contentManager = toolWindow.getContentManager();
Content generalContent = contentManager.getContent(0);
if (generalContent != null && contentManager.getContentCount() == 1) {
generalContent.setDisplayName("General");
}
final Editor editor = console.getConsoleEditor();
SimpleToolWindowPanel panel = new SimpleToolWindowPanel(false, true) {
@Override
public Object getData(@NonNls String dataId) {
return PlatformDataKeys.HELP_ID.is(dataId) ? EventLog.HELP_ID : super.getData(dataId);
}
};
panel.setContent(editor.getComponent());
panel.addAncestorListener(new LogShownTracker(project));
ActionToolbar toolbar = createToolbar(project, editor, console);
toolbar.setTargetComponent(editor.getContentComponent());
panel.setToolbar(toolbar.getComponent());
Content content = ContentFactory.SERVICE.getInstance().createContent(panel, title, false);
contentManager.addContent(content);
contentManager.setSelectedContent(content);
}
示例13: getContentManager
import com.intellij.openapi.wm.ToolWindow; //导入方法依赖的package包/类
@Override
public ContentManager getContentManager() {
if (myContentManager == null && Registry.is("vcs.merge.toolwindows")) {
final ToolWindow changes = ToolWindowManager.getInstance(myProject).getToolWindow(ToolWindowId.VCS);
myContentManager = changes == null ? null : changes.getContentManager();
}
return myContentManager;
}
示例14: createOrSelectContentIfNeeded
import com.intellij.openapi.wm.ToolWindow; //导入方法依赖的package包/类
private void createOrSelectContentIfNeeded() {
ToolWindow toolWindow = getToolWindow(myVcs.getProject());
if (myRefresherI.isFirstTime()) {
ContentManager manager = toolWindow.getContentManager();
boolean selectedExistingContent = ContentUtilEx.selectContent(manager, myFileHistoryPanel, true);
if (!selectedExistingContent) {
ContentUtilEx.addTabbedContent(manager, myFileHistoryPanel, "History", myPath.getName(), true);
}
toolWindow.activate(null);
}
}
示例15: UsageViewManagerImpl
import com.intellij.openapi.wm.ToolWindow; //导入方法依赖的package包/类
public UsageViewManagerImpl(final Project project, final ToolWindowManager toolWindowManager) {
ToolWindow toolWindow = toolWindowManager.registerToolWindow(ToolWindowId.FIND, true, ToolWindowAnchor.BOTTOM, project, true);
toolWindow.setToHideOnEmptyContent(true);
toolWindow.setIcon(AllIcons.Toolwindows.ToolWindowFind);
myFindContentManager = toolWindow.getContentManager();
myFindContentManager.addContentManagerListener(new ContentManagerAdapter() {
@Override
public void contentRemoved(ContentManagerEvent event) {
event.getContent().release();
}
});
new ContentManagerWatcher(toolWindow, myFindContentManager);
}