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


Java ContentManager.addContent方法代码示例

本文整理汇总了Java中com.intellij.ui.content.ContentManager.addContent方法的典型用法代码示例。如果您正苦于以下问题:Java ContentManager.addContent方法的具体用法?Java ContentManager.addContent怎么用?Java ContentManager.addContent使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.intellij.ui.content.ContentManager的用法示例。


在下文中一共展示了ContentManager.addContent方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createToolWindowContent

import com.intellij.ui.content.ContentManager; //导入方法依赖的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);
  }
}
 
开发者ID:medvector,项目名称:educational-plugin,代码行数:20,代码来源:StudyToolWindowFactory.java

示例2: initToolWindow

import com.intellij.ui.content.ContentManager; //导入方法依赖的package包/类
@Override
protected void initToolWindow() {
  myToolWindow = ToolWindowManager.getInstance(myProject).registerToolWindow(DesignerBundle.message("designer.toolwindow.name"),
                                                                             false, getAnchor(), myProject, true);
  myToolWindow.setIcon(UIDesignerNewIcons.ToolWindow);

  if (!ApplicationManager.getApplication().isHeadlessEnvironment()) {
    myToolWindow.getComponent().putClientProperty(ToolWindowContentUi.HIDE_ID_LABEL, "true");
  }

  ((ToolWindowEx)myToolWindow).setTitleActions(myToolWindowContent.createActions());
  initGearActions();

  ContentManager contentManager = myToolWindow.getContentManager();
  Content content =
    contentManager.getFactory()
      .createContent(myToolWindowContent.getToolWindowPanel(), DesignerBundle.message("designer.toolwindow.title"), false);
  content.setCloseable(false);
  content.setPreferredFocusableComponent(myToolWindowContent.getComponentTree());
  contentManager.addContent(content);
  contentManager.setSelectedContent(content, true);
  myToolWindow.setAvailable(false, null);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:24,代码来源:DesignerToolWindowManager.java

示例3: addOrReplaceContent

import com.intellij.ui.content.ContentManager; //导入方法依赖的package包/类
public static void addOrReplaceContent(ContentManager manager, Content content, boolean select) {
  final String contentName = content.getDisplayName();

  Content[] contents = manager.getContents();
  Content oldContentFound = null;
  for(Content oldContent: contents) {
    if (!oldContent.isPinned() && oldContent.getDisplayName().equals(contentName)) {
      oldContentFound = oldContent;
      break;
    }
  }

  manager.addContent(content);
  if (oldContentFound != null) {
    manager.removeContent(oldContentFound, true);
  }
  if (select) {
    manager.setSelectedContent(content);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:21,代码来源:ContentsUtil.java

示例4: initToolWindow

import com.intellij.ui.content.ContentManager; //导入方法依赖的package包/类
@Override
protected void initToolWindow() {
  myToolWindow = ToolWindowManager.getInstance(myProject).registerToolWindow(UIDesignerBundle.message("toolwindow.ui.designer.name"),
                                                                             false, getAnchor(), myProject, true);
  myToolWindow.setIcon(UIDesignerIcons.ToolWindowUIDesigner);

  if (!ApplicationManager.getApplication().isHeadlessEnvironment()) {
    myToolWindow.getComponent().putClientProperty(ToolWindowContentUi.HIDE_ID_LABEL, "true");
  }

  initGearActions();

  ContentManager contentManager = myToolWindow.getContentManager();
  Content content =
    contentManager.getFactory()
      .createContent(myToolWindowPanel.getToolWindowPanel(), UIDesignerBundle.message("toolwindow.ui.designer.title"), false);
  content.setCloseable(false);
  content.setPreferredFocusableComponent(myToolWindowPanel.getComponentTree());
  contentManager.addContent(content);
  contentManager.setSelectedContent(content, true);
  myToolWindow.setAvailable(false, null);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:23,代码来源:DesignerToolWindowManager.java

示例5: setUpToolWindow

import com.intellij.ui.content.ContentManager; //导入方法依赖的package包/类
private Content setUpToolWindow() {
  //Create runner UI layout
  final RunnerLayoutUi.Factory factory = RunnerLayoutUi.Factory.getInstance(myProject);
  final RunnerLayoutUi layoutUi = factory.create("", "", "session", myProject);

  // Adding actions
  DefaultActionGroup group = new DefaultActionGroup();
  group.add(myKillAction);
  group.addSeparator();

  layoutUi.getOptions().setLeftToolbar(group, ActionPlaces.UNKNOWN);

  final Content console = layoutUi.createContent(CONSOLE_ID, myConsole.getComponent(), "", null, null);
  layoutUi.addContent(console, 0, PlaceInGrid.right, false);

  final JComponent uiComponent = layoutUi.getComponent();
  myPanel.add(uiComponent, BorderLayout.CENTER);

  final ContentManager manager = myToolWindow.getContentManager();
  final ContentFactory contentFactory = ContentFactory.SERVICE.getInstance();
  final Content content = contentFactory.createContent(uiComponent, null, true);
  manager.addContent(content);
  return content;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:25,代码来源:MvcConsole.java

示例6: getToolWindow

import com.intellij.ui.content.ContentManager; //导入方法依赖的package包/类
public ToolWindow getToolWindow() {
  if (myToolWindow == null) {
    myToolWindow = ToolWindowManager.getInstance(myProject).registerToolWindow(GroovyBundle.message("dynamic.tool.window.id"), true, ToolWindowAnchor.RIGHT);
    myToolWindow.setIcon(JetgroovyIcons.Groovy.DynamicProperty_13);
    myToolWindow.setTitle(GroovyBundle.message("dynamic.window"));
    myToolWindow.setToHideOnEmptyContent(true);

    final JPanel panel = buildBigPanel();
    final ContentManager contentManager = myToolWindow.getContentManager();
    final Content content = contentManager.getFactory().createContent(panel, "", false);
    content.setPreferredFocusableComponent(myTreeTable);
    contentManager.addContent(content);
  }

  return myToolWindow;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:17,代码来源:DynamicToolWindowWrapper.java

示例7: CcLogsToolWindow

import com.intellij.ui.content.ContentManager; //导入方法依赖的package包/类
public CcLogsToolWindow(@NotNull Project project) {
  ToolWindow toolWindow = ToolWindowManager.getInstance(project).registerToolWindow("Logs Clever Cloud", false, ToolWindowAnchor.BOTTOM);
  ContentManager contentManager = toolWindow.getContentManager();
  ProjectSettings projectSettings = ServiceManager.getService(project, ProjectSettings.class);
  ArrayList<Application> applications = projectSettings.applications;

  for (Application application : applications) {
    TextConsoleBuilder builder = TextConsoleBuilderFactory.getInstance().createBuilder(project);
    ConsoleView console = builder.getConsole();

    Content logs = contentManager.getFactory().createContent(console.getComponent(), application.name, false);
    contentManager.addContent(logs);

    writeLogs(project, application, console);
    String oldLogs = CcApi.getInstance(project).logRequest(application);

    if (oldLogs != null && !oldLogs.isEmpty()) {
      WebSocketCore.printSocket(console, oldLogs);
    }
    else if (oldLogs != null && oldLogs.isEmpty()) {
      WebSocketCore.printSocket(console, "No logs available.\n");
    }
  }
}
 
开发者ID:CleverCloud,项目名称:clever-intellij-plugin,代码行数:25,代码来源:CcLogsToolWindow.java

示例8: createToolWindowContent

import com.intellij.ui.content.ContentManager; //导入方法依赖的package包/类
@Override
public void createToolWindowContent(@NotNull Project project, @NotNull ToolWindow toolWindow) {
  logger.info("Initializing Pastes ToolWindow");
  toolWindow.setStripeTitle("Ultimate PasteBin");
  toolWindow.setTitle("Ultimate PasteBin");

  ContentManager contentManager = toolWindow.getContentManager();

  Content content = contentManager.getFactory().createContent(toolWindow.getComponent(), null, false);

  ToolWindowService service = ServiceManager.getService(ToolWindowService.class);

  // Panel with toolbar
  SimpleToolWindowPanel simpleToolWindowPanel = new SimpleToolWindowPanel(true);

  // Scrolable panel
  JBScrollPane jbScrollPane = new JBScrollPane(service.getTree());
  simpleToolWindowPanel.add(jbScrollPane);
  simpleToolWindowPanel.setToolbar(createToolbar());

  content.setComponent(simpleToolWindowPanel);

  contentManager.addContent(content);

  toolWindow.activate(this::firstTimeOpen);
}
 
开发者ID:kennedyoliveira,项目名称:ultimate-pastebin-intellij-plugin,代码行数:27,代码来源:UltimatePasteBinToolWindow.java

示例9: updateToolWindow

import com.intellij.ui.content.ContentManager; //导入方法依赖的package包/类
private void updateToolWindow(@NotNull Project project, @NotNull ToolWindow toolWindow) {
    ContentManager contentManager = toolWindow.getContentManager();
    contentManager.removeAllContents(true);

    FileEditorManager fileEditorManager = FileEditorManager.getInstance(project);
    Editor selectedEditor = fileEditorManager.getSelectedTextEditor();
    if (selectedEditor == null) return;
    PsiFile psiFile = PsiDocumentManager.getInstance(project).getPsiFile(selectedEditor.getDocument());
    if (psiFile == null || !psiFile.getLanguage().equals(PythonLanguage.INSTANCE)) {
        return;
    }

    FileEditor fileEditor = fileEditorManager.getSelectedEditor(psiFile.getVirtualFile());
    StructureView structureView = new PTestStructureViewFactory().getStructureViewBuilder(psiFile).createStructureView(fileEditor, project);

    Content content = ContentFactory.SERVICE.getInstance().createContent(structureView.getComponent(), "", false);
    contentManager.addContent(content);
}
 
开发者ID:KarlGong,项目名称:ptest-pycharm-plugin,代码行数:19,代码来源:PTestViewToolWindowFactory.java

示例10: createToolWindowContent

import com.intellij.ui.content.ContentManager; //导入方法依赖的package包/类
@Override
public void createToolWindowContent(
    @NotNull final Project project, @NotNull ToolWindow toolWindow) {
  toolWindow.setAvailable(true, null);
  toolWindow.setToHideOnEmptyContent(true);

  RunnerLayoutUi runnerLayoutUi = BuckUIManager.getInstance(project).getLayoutUi(project);
  Content consoleContent = createConsoleContent(runnerLayoutUi, project);

  runnerLayoutUi.addContent(consoleContent, 0, PlaceInGrid.center, false);
  runnerLayoutUi.getOptions().setLeftToolbar(
      getLeftToolbarActions(project), ActionPlaces.UNKNOWN);

  runnerLayoutUi.updateActionsNow();

  final ContentManager contentManager = toolWindow.getContentManager();
  Content content = contentManager.getFactory().createContent(
      runnerLayoutUi.getComponent(), "", true);
  contentManager.addContent(content);

  updateBuckToolWindowTitle(project);
}
 
开发者ID:wangyanxing,项目名称:Buck-IntelliJ-Plugin,代码行数:23,代码来源:BuckToolWindowFactory.java

示例11: createToolWindowContent

import com.intellij.ui.content.ContentManager; //导入方法依赖的package包/类
@Override
public void createToolWindowContent(@NotNull final Project project, @NotNull ToolWindow toolWindow) {
    final MCSettingsProvider settings = MCSettingsProvider.getInstance(project);

    final ContentManager contentManager = toolWindow.getContentManager();
    final ContentFactory contentFactory = ContentFactory.SERVICE.getInstance();
    final String mayaLogPath = PathManager.getPluginTempPath()
            + String.format(MayaCommInterface.LOG_FILENAME_STRING, settings.getPort());

    final MayaLogConsole console = new MayaLogConsole(project, new File(mayaLogPath),
            Charset.defaultCharset(), 0L, "MayaLog", false, GlobalSearchScope.allScope(project));

    final Content content = contentFactory.createContent(console.getComponent(), "", false);
    contentManager.addContent(content);

    toolWindow.setAvailable(true, null);
    toolWindow.setToHideOnEmptyContent(true);
    toolWindow.activate(console::activate);
}
 
开发者ID:cmcpasserby,项目名称:MayaCharm,代码行数:20,代码来源:MayaLogWindow.java

示例12: initToolWindow

import com.intellij.ui.content.ContentManager; //导入方法依赖的package包/类
@Override
protected void initToolWindow() {
  myToolWindow = ToolWindowManager.getInstance(myProject).registerToolWindow(CordovaDesignerBundle.message("designer.toolwindow.name"),
                                                                             false, getAnchor(), myProject, true);
  myToolWindow.setIcon(CordovaIcons.Designer.ToolWindow);

  if (!ApplicationManager.getApplication().isHeadlessEnvironment()) {
    myToolWindow.getComponent().putClientProperty(ToolWindowContentUi.HIDE_ID_LABEL, "true");
  }

  ((ToolWindowEx)myToolWindow).setTitleActions(myToolWindowContent.createActions());
  initGearActions();

  ContentManager contentManager = myToolWindow.getContentManager();
  Content content =
    contentManager.getFactory()
      .createContent(myToolWindowContent.getToolWindowPanel(), CordovaDesignerBundle.message("designer.toolwindow.title"), false);
  content.setCloseable(false);
  content.setPreferredFocusableComponent(myToolWindowContent.getComponentTree());
  contentManager.addContent(content);
  contentManager.setSelectedContent(content, true);
  myToolWindow.setAvailable(false, null);
}
 
开发者ID:chrimm,项目名称:cordovastudio,代码行数:24,代码来源:CordovaDesignerToolWindowManager.java

示例13: 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

示例14: initToolWindow

import com.intellij.ui.content.ContentManager; //导入方法依赖的package包/类
@Override
protected void initToolWindow()
{
	myToolWindow = ToolWindowManager.getInstance(myProject).registerToolWindow(UIDesignerBundle.message("toolwindow.ui.designer.name"), false, getAnchor(), myProject, true);
	myToolWindow.setIcon(UIDesignerIcons.ToolWindowUIDesigner);

	if(!ApplicationManager.getApplication().isHeadlessEnvironment())
	{
		myToolWindow.getComponent().putClientProperty(ToolWindowContentUI.HIDE_ID_LABEL, "true");
	}

	initGearActions();

	ContentManager contentManager = myToolWindow.getContentManager();
	Content content = contentManager.getFactory().createContent(myToolWindowPanel.getToolWindowPanel(), UIDesignerBundle.message("toolwindow.ui.designer.title"), false);
	content.setCloseable(false);
	content.setPreferredFocusableComponent(myToolWindowPanel.getComponentTree());
	contentManager.addContent(content);
	contentManager.setSelectedContent(content, true);
	myToolWindow.setAvailable(false, null);
}
 
开发者ID:consulo,项目名称:consulo-ui-designer,代码行数:22,代码来源:DesignerToolWindowManager.java

示例15: initToolWindow

import com.intellij.ui.content.ContentManager; //导入方法依赖的package包/类
@Override
protected void initToolWindow()
{
	myToolWindow = ToolWindowManager.getInstance(myProject).registerToolWindow(IdeBundle.message("toolwindow.palette"), false, getAnchor(),
			myProject, true);
	myToolWindow.setIcon(AllIcons.Toolwindows.ToolWindowPalette);
	initGearActions();

	ContentManager contentManager = myToolWindow.getContentManager();
	Content content = contentManager.getFactory().createContent(myToolWindowPanel, null, false);
	content.setCloseable(false);
	content.setPreferredFocusableComponent(myToolWindowPanel);
	contentManager.addContent(content);
	contentManager.setSelectedContent(content, true);
	myToolWindow.setAvailable(false, null);
}
 
开发者ID:consulo,项目名称:consulo-ui-designer,代码行数:17,代码来源:PaletteToolWindowManager.java


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