當前位置: 首頁>>代碼示例>>Java>>正文


Java ContentFactory.createContent方法代碼示例

本文整理匯總了Java中com.intellij.ui.content.ContentFactory.createContent方法的典型用法代碼示例。如果您正苦於以下問題:Java ContentFactory.createContent方法的具體用法?Java ContentFactory.createContent怎麽用?Java ContentFactory.createContent使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.intellij.ui.content.ContentFactory的用法示例。


在下文中一共展示了ContentFactory.createContent方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: createToolWindowContent

import com.intellij.ui.content.ContentFactory; //導入方法依賴的package包/類
@Override
public void createToolWindowContent(@NotNull Project project, @NotNull ToolWindow toolWindow) {
    ContentFactory contentFactory = ContentFactory.SERVICE.getInstance();
    Set<SelectedExchangeCurrencyPair> selectedExchangeCurrencyPairs = IdeaCurrencyConfig.getInstance().getSelectedExchangeCurrencyPairs();
    if (IdeaCurrencyConfig.getInstance().getActive()) {
        List<TickerDto> data = IdeaCurrencyApp.getInstance().getTickers(selectedExchangeCurrencyPairs);
        fillData(data);
    }
    Content content = contentFactory.createContent(contentPane, "", false);
    toolWindow.getContentManager().addContent(content);

    MessageBus messageBus = project.getMessageBus();
    messageBusConnection = messageBus.connect();
    messageBusConnection.subscribe(ConfigChangeNotifier.CONFIG_TOPIC, active -> {
        if (active) {
            scheduleNextTask();
        }
    });
}
 
開發者ID:semihunaldi,項目名稱:IdeaCurrency,代碼行數:20,代碼來源:IdeaCurrencyToolWindow.java

示例2: createWindow

import com.intellij.ui.content.ContentFactory; //導入方法依賴的package包/類
public void createWindow(Project project) {
    jFXPanel = new JFXPanel();
    ToolWindow toolWindow = ToolWindowManager.getInstance(project).registerToolWindow("Basis.js", false, ToolWindowAnchor.BOTTOM, false);
    toolWindow.setIcon(IconLoader.getIcon("/icons/basisjs.png"));
    ContentFactory contentFactory = ContentFactory.SERVICE.getInstance();
    Content content = contentFactory.createContent(jFXPanel, "inspector", false);
    toolWindow.getContentManager().addContent(content);

    InspectorController sceneInspectorController = new InspectorController();
    FXMLLoader fxmlLoader = new FXMLLoader();
    fxmlLoader.setLocation(getClass().getResource("/com/basisjs/ui/windows/tools/inspector/InspectorScene.fxml"));
    fxmlLoader.setController(sceneInspectorController);

    Platform.setImplicitExit(false);
    PlatformImpl.runLater(() -> {
        try {
            Scene scene = new Scene(fxmlLoader.load());
            jFXPanel.setScene(scene);
            webView = sceneInspectorController.webView;
            webView.setContextMenuEnabled(false);
        } catch (IOException e) {
            e.printStackTrace();
        }
    });
}
 
開發者ID:smelukov,項目名稱:intellij-basisjs-plugin,代碼行數:26,代碼來源:InspectorWindow.java

示例3: buildGUI

import com.intellij.ui.content.ContentFactory; //導入方法依賴的package包/類
public SearchToolWindowGUI buildGUI(@NotNull ToolWindow toolWindow, Project project) {

        SearchToolWindowGUI windowGUI = null;
        JPanel jPanel;
        if(isJavaFXAvailable()) {
            windowGUI = new SearchToolWindowGUI.SearchToolWindowGUIBuilder()
                    .setContent(content)
                    .setProject(project)
                    .setSearchModel(project.getComponent(UserTagStatComponent.class).getSearchModel()).build();
            jPanel = windowGUI.getContentPanel();
        } else {
            jPanel = getNoJavaFXFoundPanel();
        }

        ContentFactory contentFactory = ContentFactory.SERVICE.getInstance();
        Content windowContent = contentFactory.createContent(jPanel, "", false);
        toolWindow.getContentManager().addContent(windowContent);

        return windowGUI;
    }
 
開發者ID:vcu-swim-lab,項目名稱:stack-intheflow,代碼行數:21,代碼來源:SearchToolWindowFactory.java

示例4: setUpToolWindow

import com.intellij.ui.content.ContentFactory; //導入方法依賴的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

示例5: createToolWindowContent

import com.intellij.ui.content.ContentFactory; //導入方法依賴的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

示例6: createToolWindowContent

import com.intellij.ui.content.ContentFactory; //導入方法依賴的package包/類
@Override
public void createToolWindowContent(Project project, ToolWindow toolWindow) {
    final Document document = new PlainDocument();
    final NetConsoleClient netConsole = new NetConsoleClient(document);

    final JXTextArea textArea = new JXTextArea();
    textArea.setDocument(document);
    textArea.setEditable(false);

    final DefaultActionGroup actionGroup = new DefaultActionGroup();
    actionGroup.addAction(new AutoScrollAction(netConsole, textArea));
    actionGroup.addAction(new ClearAction(netConsole));
    actionGroup.addAction(new DisableAction(netConsole, textArea));

    final SimpleToolWindowPanel netConsolePanel = new SimpleToolWindowPanel(false, false);
    final ActionToolbar toolbar = ActionManager.getInstance().createActionToolbar(ActionPlaces.UNKNOWN,
            actionGroup, false);
    netConsolePanel.setToolbar(toolbar.getComponent());
    netConsolePanel.setContent(new JBScrollPane(textArea));

    final ContentFactory contentFactory = ContentFactory.SERVICE.getInstance();
    final Content content = contentFactory.createContent(netConsolePanel, "", true);
    toolWindow.getContentManager().addContent(content);
}
 
開發者ID:ThomasJClark,項目名稱:netconsole-idea-plugin,代碼行數:25,代碼來源:NetConsoleToolWindowFactory.java

示例7: FilesystemToolwindow

import com.intellij.ui.content.ContentFactory; //導入方法依賴的package包/類
public FilesystemToolwindow(final VirtualFile root, Project project) {
  myRoot = root;
  myProject = project;

  myToolWindow = ToolWindowManager.getInstance(project).registerToolWindow("File System", false, ToolWindowAnchor.LEFT);
  myContent = new MyContent();

  final FileChooserDescriptor descriptor = new FileChooserDescriptor(true, true, true, false, true, true);
  descriptor.setRoots(myRoot);

  myFsTree = new FileSystemTreeImpl(project, descriptor);
  myContent.add(ScrollPaneFactory.createScrollPane(myFsTree.getTree()), BorderLayout.CENTER);
  EditSourceOnDoubleClickHandler.install(myFsTree.getTree());
  EditSourceOnEnterKeyHandler.install(myFsTree.getTree());

  final ContentFactory contentFactory = new ContentFactoryImpl();
  final Content content = contentFactory.createContent(myContent, null, false);
  myToolWindow.getContentManager().addContent(content);
}
 
開發者ID:lshain-android-source,項目名稱:tools-idea,代碼行數:20,代碼來源:FilesystemToolwindow.java

示例8: recalculateWindows

import com.intellij.ui.content.ContentFactory; //導入方法依賴的package包/類
private void recalculateWindows() {
  final GitVcs vcs = GitVcs.getInstance(myProject);
  final VirtualFile[] roots = myVcsManager.getRootsUnderVcs(vcs);
  final List<VirtualFile> fileList = Arrays.asList(roots);

  final ChangesViewContentI cvcm = ChangesViewContentManager.getInstance(myProject);
  final Content currContent = myCurrentContent.get();
  if (currContent != null) {
    myLogRef.get().rootsChanged(fileList);
    return;
  }
  final GitLog gitLog = myLogFactoryService.createComponent(true);
  final ContentFactory contentFactory = ContentFactory.SERVICE.getInstance();
  final Content content = contentFactory.createContent(gitLog.getVisualComponent(), CONTENT_KEY, false);
  content.setCloseable(false);
  cvcm.addContent(content);
  Disposer.register(content, gitLog);
  myLogRef.set(gitLog);

  myCurrentContent.set(content);
  gitLog.rootsChanged(fileList);
}
 
開發者ID:lshain-android-source,項目名稱:tools-idea,代碼行數:23,代碼來源:GitProjectLogManager.java

示例9: createToolWindows

import com.intellij.ui.content.ContentFactory; //導入方法依賴的package包/類
public void createToolWindows() {
	LOG.info("createToolWindows "+project.getName());
	ToolWindowManager toolWindowManager = ToolWindowManager.getInstance(project);

	previewPanel = new PreviewPanel(project);

	ContentFactory contentFactory = ContentFactory.SERVICE.getInstance();
	Content content = contentFactory.createContent(previewPanel, "", false);

	previewWindow = toolWindowManager.registerToolWindow(PREVIEW_WINDOW_ID, true, ToolWindowAnchor.BOTTOM);
	previewWindow.getContentManager().addContent(content);
	previewWindow.setIcon(Icons.FILE);

	TextConsoleBuilderFactory factory = TextConsoleBuilderFactory.getInstance();
	TextConsoleBuilder consoleBuilder = factory.createBuilder(project);
	this.console = consoleBuilder.getConsole();

	JComponent consoleComponent = console.getComponent();
	content = contentFactory.createContent(consoleComponent, "", false);

	consoleWindow = toolWindowManager.registerToolWindow(CONSOLE_WINDOW_ID, true, ToolWindowAnchor.BOTTOM);
	consoleWindow.getContentManager().addContent(content);
	consoleWindow.setIcon(Icons.FILE);
}
 
開發者ID:antlr,項目名稱:intellij-plugin-v4,代碼行數:25,代碼來源:ANTLRv4PluginController.java

示例10: init

import com.intellij.ui.content.ContentFactory; //導入方法依賴的package包/類
@RequiredUIAccess
@Override
protected void init(boolean canCloseContent, @Nullable Object component) {
  final ContentFactory contentFactory = ContentFactory.getInstance();
  myContentUI = new DesktopToolWindowContentUi(this);
  ContentManager contentManager = myContentManager = contentFactory.createContentManager(myContentUI, canCloseContent, myToolWindowManager.getProject());

  if (component != null) {
    final Content content = contentFactory.createContent((JComponent)component, "", false);
    contentManager.addContent(content);
    contentManager.setSelectedContent(content, false);
  }

  myComponent = contentManager.getComponent();

  installToolwindowFocusPolicy();

  UiNotifyConnector notifyConnector = new UiNotifyConnector(myComponent, new Activatable.Adapter() {
    @Override
    public void showNotify() {
      myShowing.onReady();
    }
  });
  Disposer.register(contentManager, notifyConnector);
}
 
開發者ID:consulo,項目名稱:consulo,代碼行數:26,代碼來源:DesktopToolWindowImpl.java

示例11: actionPerformed

import com.intellij.ui.content.ContentFactory; //導入方法依賴的package包/類
@Override
public void actionPerformed(AnActionEvent anActionEvent) {
  Project project = getEventProject(anActionEvent);

  ToolWindowManager toolWindowManager = ToolWindowManager.getInstance(project);
  ToolWindow toolWindow = toolWindowManager.getToolWindow(UNCHAIN_TOOLWINDOW_ID);
  if (toolWindow == null) {
    toolWindow = toolWindowManager.registerToolWindow(UNCHAIN_TOOLWINDOW_ID, false, ToolWindowAnchor.RIGHT);
    ContentFactory contentFactory = toolWindow.getContentManager().getFactory();
    PsiFile psiFile = anActionEvent.getData(LangDataKeys.PSI_FILE);
    PsiClass psiClass = null;
    if (psiFile instanceof PsiJavaFile) {
      PsiClass[] classes = ((PsiJavaFile) psiFile).getClasses();
      if (classes.length > 0) {
        psiClass = classes[0];
      }
    }
    Content content = contentFactory.createContent(new UnchainPanel(project, psiClass), "", false);
    toolWindow.getContentManager().addContent(content);
  }
  toolWindow.activate(null);
}
 
開發者ID:JetBrains,項目名稱:hackathon-unchain,代碼行數:23,代碼來源:UnchainAction.java

示例12: createToolWindowContent

import com.intellij.ui.content.ContentFactory; //導入方法依賴的package包/類
@Override
public void createToolWindowContent(@NotNull Project project, @NotNull ToolWindow toolWindow) {
    ContentFactory contentFactory = ContentFactory.SERVICE.getInstance();
    Content content = contentFactory.createContent(pnlMain, "", false);
    toolWindow.getContentManager().addContent(content);
    toolWindow.setIcon(Icons.PLUGIN_ICON);

    addBtnRefreshListener();
    addBtnGroupProjectListener();
    addBtnGroupCommitterListener();
    addBtnResetListener();
}
 
開發者ID:waarneembemiddeling,項目名稱:intellij-circleci-integration,代碼行數:13,代碼來源:RecentBuildsToolWindowFactory.java

示例13: createContents

import com.intellij.ui.content.ContentFactory; //導入方法依賴的package包/類
private void createContents(@NotNull Project project, @NotNull ToolWindow toolWindow) {
    SmartQQPanel qqPanel = new SmartQQPanel(project, toolWindow);
    ContentFactory contentFactory = ContentFactory.SERVICE.getInstance();
    Content content = contentFactory.createContent(qqPanel, "SmartQQ", false);
    toolWindow.getContentManager().addContent(content, 0);

    WechatPanel wechatPanel = new WechatPanel(project, toolWindow);
    content = contentFactory.createContent(wechatPanel, "Wechat", false);
    toolWindow.getContentManager().addContent(content, 1);
}
 
開發者ID:Jamling,項目名稱:SmartQQ4IntelliJ,代碼行數:11,代碼來源:IMWindowFactory.java

示例14: createContentPanel

import com.intellij.ui.content.ContentFactory; //導入方法依賴的package包/類
private Content createContentPanel(Project project, ToolWindow toolWindow) {
    System.out.println("project:" + project);
    panel = new SmartQQPanel(project, toolWindow);
    ContentFactory contentFactory = ContentFactory.SERVICE.getInstance();
    Content content = contentFactory.createContent(panel, "", false);
    return content;
}
 
開發者ID:Jamling,項目名稱:SmartQQ4IntelliJ,代碼行數:8,代碼來源:IMWindowFactory.java

示例15: callProtractor

import com.intellij.ui.content.ContentFactory; //導入方法依賴的package包/類
private void callProtractor() {
    try {
        Config config = Config.getInstance(project);

        if (config == null) {
            return;
        }

        GeneralCommandLine command = getProtractorRunCommand(config);
        Process p = command.createProcess();

        if (project != null) {
            ToolWindowManager manager = ToolWindowManager.getInstance(project);
            String id = "Gherkin Runner";
            TextConsoleBuilderFactory factory = TextConsoleBuilderFactory.getInstance();
            TextConsoleBuilder builder = factory.createBuilder(project);
            ConsoleView view = builder.getConsole();

            ColoredProcessHandler handler = new ColoredProcessHandler(p, command.getPreparedCommandLine());
            handler.startNotify();
            view.attachToProcess(handler);

            ToolWindow window = manager.getToolWindow(id);
            Icon cucumberIcon = IconLoader.findIcon("/resources/icons/cucumber.png");

            if (window == null) {
                window = manager.registerToolWindow(id, true, ToolWindowAnchor.BOTTOM);
                window.setIcon(cucumberIcon);
            }

            ContentFactory cf = window.getContentManager().getFactory();
            Content c = cf.createContent(view.getComponent(), "Run " + (window.getContentManager().getContentCount() + 1), true);

            window.getContentManager().addContent(c);
        }
    } catch (Exception e) {
        System.out.println(e.getMessage());
    }
}
 
開發者ID:KariiO,項目名稱:Gherkin-TS-Runner,代碼行數:40,代碼來源:GherkinIconRenderer.java


注:本文中的com.intellij.ui.content.ContentFactory.createContent方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。