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


Java Content.getComponent方法代码示例

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


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

示例1: getRNConsole

import com.intellij.ui.content.Content; //导入方法依赖的package包/类
/**
 * 获取 RN Console实例.
 *
 * @param displayName - the tab's display name must be unique.
 * @param icon        - used to set a tab icon, not used for search
 * @return
 */
public RNConsoleImpl getRNConsole(String displayName, Icon icon) {
    ToolWindow window = ToolWindowManager.getInstance(myProject).getToolWindow(RNToolWindowFactory.TOOL_WINDOW_ID);
    if (window != null) {
        Content existingContent = createConsoleTabContent(window, false, displayName, icon);
        if (existingContent != null) {
            final JComponent existingComponent = existingContent.getComponent();

            if (existingComponent instanceof SimpleToolWindowPanel) {
                JComponent component = ((SimpleToolWindowPanel) existingComponent).getContent();
                if (component instanceof RNConsoleImpl) {
                    RNConsoleImpl rnConsole = (RNConsoleImpl) component;
                    return rnConsole;
                }
            }
        }
    }

    return null;
}
 
开发者ID:beansoftapp,项目名称:react-native-console,代码行数:27,代码来源:ReactNativeConsole.java

示例2: updateTarget

import com.intellij.ui.content.Content; //导入方法依赖的package包/类
private void updateTarget() {
    targetPanel.setLayout(new GridLayout(0, 1, 0, 0));
    if (IMWindowFactory.getDefault() == null || IMWindowFactory.getDefault().getProject() == null) {
        return;
    }
    ToolWindow window = ToolWindowManager.getInstance(IMWindowFactory.getDefault().getProject()).getToolWindow(IMWindowFactory.TOOL_WINDOW_ID);
    if (window != null) {
        Content[] contents = window.getContentManager().getContents();
        if (contents != null) {
            for (Content content : contents) {
                if (content.getComponent() != null && content.getComponent() instanceof IMPanel) {
                    IMPanel panel = (IMPanel) content.getComponent();
                    List<IMChatConsole> chats = panel.getConsoleList();
                    if (!chats.isEmpty()) {
                        consoles.addAll(chats);
                        targetPanel.add(new GroupPanel(content.getDisplayName(), chats));
                    }
                }
            }
        }
    }
}
 
开发者ID:Jamling,项目名称:SmartQQ4IntelliJ,代码行数:23,代码来源:ReviewDialog.java

示例3: getStudyToolWindow

import com.intellij.ui.content.Content; //导入方法依赖的package包/类
@Nullable
public static StudyToolWindow getStudyToolWindow(@NotNull final Project project) {
  if (project.isDisposed()) return null;

  ToolWindow toolWindow = ToolWindowManager.getInstance(project).getToolWindow(StudyToolWindowFactory.STUDY_TOOL_WINDOW);
  if (toolWindow != null) {
    Content[] contents = toolWindow.getContentManager().getContents();
    for (Content content: contents) {
      JComponent component = content.getComponent();
      if (component != null && component instanceof StudyToolWindow) {
        return (StudyToolWindow)component;
      }
    }
  }
  return null;
}
 
开发者ID:medvector,项目名称:educational-plugin,代码行数:17,代码来源:StudyUtils.java

示例4: findContentComponent

import com.intellij.ui.content.Content; //导入方法依赖的package包/类
/**
 * Searches through all {@link Content simple} and {@link TabbedContent tabbed} contents of the given ContentManager,
 * trying to find the first one which matches the given condition.
 */
@Nullable
public static JComponent findContentComponent(@NotNull ContentManager manager, @NotNull Condition<JComponent> condition) {
  for (Content content : manager.getContents()) {
    if (content instanceof TabbedContentImpl) {
      List<Pair<String, JComponent>> tabs = ((TabbedContentImpl)content).getTabs();
      for (Pair<String, JComponent> tab : tabs) {
        if (condition.value(tab.second)) {
          return tab.second;
        }
      }
    }
    else if (condition.value(content.getComponent())) {
      return content.getComponent();
    }
  }
  return null;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:22,代码来源:ContentUtilEx.java

示例5: updateToolWindows

import com.intellij.ui.content.Content; //导入方法依赖的package包/类
public static void updateToolWindows() {
  for (Project project : ProjectManager.getInstance().getOpenProjects()) {
    final ToolWindowManager toolWindowManager = ToolWindowManager.getInstance(project);
    for (String id : toolWindowManager.getToolWindowIds()) {
      final ToolWindow toolWindow = toolWindowManager.getToolWindow(id);
      for (Content content : toolWindow.getContentManager().getContents()) {
        final JComponent component = content.getComponent();
        if (component != null) {
          IJSwingUtilities.updateComponentTreeUI(component);
        }
      }
      final JComponent c = toolWindow.getComponent();
      if (c != null) {
        IJSwingUtilities.updateComponentTreeUI(c);
      }
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:19,代码来源:LafManagerImpl.java

示例6: removeContents

import com.intellij.ui.content.Content; //导入方法依赖的package包/类
protected void removeContents(Content notToRemove, final String tabDisplayName) {
  MessageView messageView = MessageView.SERVICE.getInstance(myProject);
  Content[] contents = messageView.getContentManager().getContents();
  for (Content content : contents) {
    LOG.assertTrue(content != null);
    if (content.isPinned()) continue;
    if (tabDisplayName.equals(content.getDisplayName()) && content != notToRemove) {
      ErrorTreeView listErrorView = (ErrorTreeView)content.getComponent();
      if (listErrorView != null) {
        if (messageView.getContentManager().removeContent(content, true)) {
          content.release();
        }
      }
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:17,代码来源:AbstractVcsHelperImpl.java

示例7: getActiveDocComponent

import com.intellij.ui.content.Content; //导入方法依赖的package包/类
@Nullable
public static DocumentationComponent getActiveDocComponent(@NotNull Project project) {
  DocumentationManager documentationManager = DocumentationManager.getInstance(project);
  DocumentationComponent component;
  JBPopup hint = documentationManager.getDocInfoHint();
  if (hint != null) {
    component = (DocumentationComponent)((AbstractPopup)hint).getComponent();
  }
  else if (documentationManager.hasActiveDockedDocWindow()) {
    ToolWindow toolWindow = ToolWindowManager.getInstance(project).getToolWindow(ToolWindowId.DOCUMENTATION);
    Content selectedContent = toolWindow == null ? null : toolWindow.getContentManager().getSelectedContent();
    component = selectedContent == null ? null : (DocumentationComponent)selectedContent.getComponent();
  }
  else {
    component = null;
  }
  return component;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:19,代码来源:QuickDocUtil.java

示例8: removeContents

import com.intellij.ui.content.Content; //导入方法依赖的package包/类
private static void removeContents(@Nullable final Content notToRemove,
                                   @NotNull final Project myProject,
                                   @NotNull final String tabDisplayName) {
  MessageView messageView = ServiceManager.getService(myProject, MessageView.class);
  Content[] contents = messageView.getContentManager().getContents();
  for (Content content : contents) {
    LOG.assertTrue(content != null);
    if (content.isPinned()) continue;
    if (tabDisplayName.equals(content.getDisplayName()) && content != notToRemove) {
      ErrorTreeView listErrorView = (ErrorTreeView)content.getComponent();
      if (listErrorView != null) {
        if (messageView.getContentManager().removeContent(content, true)) {
          content.release();
        }
      }
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:19,代码来源:ExecutionHelper.java

示例9: updateSelectionInActiveProjectView

import com.intellij.ui.content.Content; //导入方法依赖的package包/类
static void updateSelectionInActiveProjectView(PsiElement newElement, Project project, boolean selectInActivePanel) {
  String id = ToolWindowManager.getInstance(project).getActiveToolWindowId();
  if (id != null) {
    ToolWindow window = ToolWindowManager.getInstance(project).getToolWindow(id);
    Content selectedContent = window.getContentManager().getSelectedContent();
    if (selectedContent != null) {
      JComponent component = selectedContent.getComponent();
      if (component instanceof TwoPaneIdeView) {
        ((TwoPaneIdeView) component).selectElement(newElement, selectInActivePanel);
        return;
      }
    }
  }
  if (ToolWindowId.PROJECT_VIEW.equals(id)) {
    ProjectView.getInstance(project).selectPsiElement(newElement, true);
  }
  else if (ToolWindowId.STRUCTURE_VIEW.equals(id)) {
    VirtualFile virtualFile = newElement.getContainingFile().getVirtualFile();
    FileEditor editor = FileEditorManager.getInstance(newElement.getProject()).getSelectedEditor(virtualFile);
    StructureViewFactoryEx.getInstanceEx(project).getStructureViewWrapper().selectCurrentElement(editor, virtualFile, true);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:23,代码来源:CopyHandler.java

示例10: getBsbConsole

import com.intellij.ui.content.Content; //导入方法依赖的package包/类
private BsConsole getBsbConsole() {
    BsConsole console = null;

    ToolWindow window = ToolWindowManager.getInstance(m_project).getToolWindow("Bucklescript");
    Content windowContent = window.getContentManager().getContent(0);
    if (windowContent != null) {
        SimpleToolWindowPanel component = (SimpleToolWindowPanel) windowContent.getComponent();
        JComponent panelComponent = component.getComponent();
        if (panelComponent != null) {
            console = (BsConsole) panelComponent.getComponent(0);
        }
    }

    return console;
}
 
开发者ID:reasonml-editor,项目名称:reasonml-idea-plugin,代码行数:16,代码来源:BucklescriptProjectComponent.java

示例11: refreshToolWindows

import com.intellij.ui.content.Content; //导入方法依赖的package包/类
private void refreshToolWindows() {

        ToolWindow toolWindow = ToolWindowManager.getInstance(project).getToolWindow(PluginProperties.getValue("toolwindows.id"));
        toolWindow.activate(null);

        for (Content content : toolWindow.getContentManager().getContents()) {
            if (content.getComponent() instanceof ToolWindowPanel) {
                ToolWindowPanel toolWindowPanel = (ToolWindowPanel) content.getComponent();
                toolWindowPanel.getRefreshAction().actionPerformed(null);
            }
        }
    }
 
开发者ID:testIT-LivingDoc,项目名称:livingdoc-intellij,代码行数:13,代码来源:ProjectSettingsEditor.java

示例12: getNavigator

import com.intellij.ui.content.Content; //导入方法依赖的package包/类
@Nullable
protected OccurenceNavigator getNavigator(DataContext dataContext) {
  ContentManager contentManager = ContentManagerUtil.getContentManagerFromContext(dataContext, false);
  if (contentManager != null) {
    Content content = contentManager.getSelectedContent();
    if (content == null) return null;
    JComponent component = content.getComponent();
    return findNavigator(component);
  }

  return (OccurenceNavigator)getOccurenceNavigatorFromContext(dataContext);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:13,代码来源:OccurenceNavigatorActionBase.java

示例13: getChildren

import com.intellij.ui.content.Content; //导入方法依赖的package包/类
@NotNull
@Override
public AnAction[] getChildren(@Nullable AnActionEvent e) {
  ContentManager contentManager = myToolWindow.getContentManager();
  Content selectedContent = contentManager.getSelectedContent();
  JComponent contentComponent = selectedContent != null ? selectedContent.getComponent() : null;
  if (contentComponent == null) return EMPTY_ARRAY;
  List<AnAction> result = ContainerUtil.newSmartList();
  for (final ActionToolbar toolbar : iterateToolbars(contentComponent)) {
    JComponent c = toolbar.getComponent();
    if (c.isVisible() || !c.isValid()) continue;
    if (!result.isEmpty() && !(ContainerUtil.getLastItem(result) instanceof Separator)) {
      result.add(Separator.getInstance());
    }

    List<AnAction> actions = toolbar.getActions(false);
    for (AnAction action : actions) {
      if (action instanceof ToggleAction && !result.contains(action)) {
        result.add(action);
      }
      else if (action instanceof Separator) {
        if (!result.isEmpty() && !(ContainerUtil.getLastItem(result) instanceof Separator)) {
          result.add(Separator.getInstance());
        }
      }
    }
  }
  boolean popup = result.size() > 3;
  setPopup(popup);
  if (!popup && !result.isEmpty()) result.add(Separator.getInstance());
  return result.toArray(new AnAction[result.size()]);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:33,代码来源:ToggleToolbarAction.java

示例14: getCurrentEnvironment

import com.intellij.ui.content.Content; //导入方法依赖的package包/类
@Nullable
private static ExecutionEnvironment getCurrentEnvironment(@NotNull Content content) {
  JComponent component = content.getComponent();
  if (component == null) {
    return null;
  }
  return LangDataKeys.EXECUTION_ENVIRONMENT.getData(DataManager.getInstance().getDataContext(component));
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:9,代码来源:AutoTestManager.java

示例15: showSettings

import com.intellij.ui.content.Content; //导入方法依赖的package包/类
@Override
public void showSettings() {
  Content selectedContent = com.intellij.usageView.UsageViewManager.getInstance(myProject).getSelectedContent(true);
  JComponent component = selectedContent == null ? null : selectedContent.getComponent();
  ReplaceInProjectManager findInProjectManager = getInstance(myProject);
  findInProjectManager.replaceInProject(DataManager.getInstance().getDataContext(component));
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:8,代码来源:ReplaceInProjectManager.java


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