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


Java ToolWindow.setIcon方法代码示例

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


在下文中一共展示了ToolWindow.setIcon方法的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);
  }
}
 
开发者ID:medvector,项目名称:educational-plugin,代码行数:20,代码来源:StudyToolWindowFactory.java

示例2: createWindow

import com.intellij.openapi.wm.ToolWindow; //导入方法依赖的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: initTerminal

import com.intellij.openapi.wm.ToolWindow; //导入方法依赖的package包/类
public void initTerminal(final ToolWindow toolWindow) {
        toolWindow.setToHideOnEmptyContent(true);
        toolWindow.setStripeTitle("RN Console");
        toolWindow.setIcon(PluginIcons.React);
        Content content = createConsoleTabContent(toolWindow, true, "Welcome", null);
//        toolWindow.getContentManager().addContent(content);
//        toolWindow.getContentManager().addContent(new ContentImpl(new JButton("Test"), "Build2", false));

        // ======= test a terminal create ======
//        LocalTerminalDirectRunner terminalRunner = LocalTerminalDirectRunner.createTerminalRunner(myProject);
//        Content testTerminalContent = createTerminalInContentPanel(terminalRunner, toolWindow);
//        toolWindow.getContentManager().addContent(testTerminalContent);

//        SimpleTerminal term  = new SimpleTerminal();
//        term.sendString("ls\n");
//        toolWindow.getContentManager().addContent(new ContentImpl(term.getComponent(), "terminal", false));
        toolWindow.setShowStripeButton(true);// if set to false, then sometimes the window will be hidden from the dock area for ever 2017-05-26
//        toolWindow.setTitle(" - ");
        ((ToolWindowManagerEx) ToolWindowManager.getInstance(this.myProject)).addToolWindowManagerListener(new ToolWindowManagerListener() {
            @Override
            public void toolWindowRegistered(@NotNull String s) {
            }

            @Override
            public void stateChanged() {
                ToolWindow window = ToolWindowManager.getInstance(myProject).getToolWindow(RNToolWindowFactory.TOOL_WINDOW_ID);
                if (window != null) {
                    boolean visible = window.isVisible();
                    if (visible && toolWindow.getContentManager().getContentCount() == 0) {
                        initTerminal(window);
                    }
                }
            }
        });
        toolWindow.show(null);
    }
 
开发者ID:beansoftapp,项目名称:react-native-console,代码行数:37,代码来源:ReactNativeConsole.java

示例4: createToolWindowContent

import com.intellij.openapi.wm.ToolWindow; //导入方法依赖的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

示例5: callProtractor

import com.intellij.openapi.wm.ToolWindow; //导入方法依赖的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

示例6: 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);
}
 
开发者ID:miche-atucha,项目名称:deps-checker,代码行数:10,代码来源:CheckVersionAction.java

示例7: projectOpened

import com.intellij.openapi.wm.ToolWindow; //导入方法依赖的package包/类
@Override
public void projectOpened() {
    Icon icon = IconLoader.getIcon(ICON_NYANDROID);
    ToolWindowManager toolWindowManager = ToolWindowManager.getInstance(project);
    ToolWindow toolWindow = toolWindowManager.getToolWindow("Logcat");
    if (toolWindow != null) {
        toolWindow.setIcon(icon);
    }
}
 
开发者ID:evant,项目名称:NyandroidRestorer,代码行数:10,代码来源:NyandroidProject.java

示例8: getToolWindow

import com.intellij.openapi.wm.ToolWindow; //导入方法依赖的package包/类
public ToolWindow getToolWindow() {
    ToolWindow toolWindow;

    String windowId = "atoum";
    if (!Arrays.asList(ToolWindowManager.getInstance(project).getToolWindowIds()).contains(windowId)) {
        toolWindow = ToolWindowManager.getInstance(project).registerToolWindow(windowId, false, ToolWindowAnchor.BOTTOM);
    } else {
        toolWindow = ToolWindowManager.getInstance(project).getToolWindow(windowId);
    }

    toolWindow.setIcon(Icons.ATOUM);
    toolWindow.show(null);

    return toolWindow;
}
 
开发者ID:atoum,项目名称:phpstorm-plugin,代码行数:16,代码来源:Runner.java

示例9: applyIconToStatusAndToolWindow

import com.intellij.openapi.wm.ToolWindow; //导入方法依赖的package包/类
private void applyIconToStatusAndToolWindow(Project project, LayeredIcon icon) {
  if (UISettings.getInstance().HIDE_TOOL_STRIPES || UISettings.getInstance().PRESENTATION_MODE) {
    setVisible(true);
    setIcon(icon);
  }
  else {
    ToolWindow eventLog = EventLog.getEventLog(project);
    if (eventLog != null) {
      eventLog.setIcon(icon);
    }
    setVisible(false);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:14,代码来源:IdeNotificationArea.java

示例10: 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);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:15,代码来源:UsageViewManagerImpl.java

示例11: HierarchyBrowserManager

import com.intellij.openapi.wm.ToolWindow; //导入方法依赖的package包/类
public HierarchyBrowserManager(final Project project) {
  ToolWindowManager toolWindowManager = ToolWindowManager.getInstance(project);
  ToolWindow toolWindow = toolWindowManager.registerToolWindow(ToolWindowId.HIERARCHY, true, ToolWindowAnchor.RIGHT, project);

  myContentManager = toolWindow.getContentManager();
  toolWindow.setIcon(AllIcons.Toolwindows.ToolWindowHierarchy);
  new ContentManagerWatcher(toolWindow, myContentManager);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:9,代码来源:HierarchyBrowserManager.java

示例12: createToolWindowContent

import com.intellij.openapi.wm.ToolWindow; //导入方法依赖的package包/类
@Override
public void createToolWindowContent(@NotNull final Project project, @NotNull final ToolWindow toolWindow) {
  toolWindow.setIcon(InteractiveLearningIcons.TaskDescription);
  StudyTaskManager taskManager = StudyTaskManager.getInstance(project);
  final Course course = taskManager.getCourse();
  if (course != null) {
    final StudyToolWindow studyToolWindow = new StudyToolWindow(project);
    final ContentManager contentManager = toolWindow.getContentManager();
    final Content content = contentManager.getFactory().createContent(studyToolWindow, null, false);
    contentManager.addContent(content);
    Disposer.register(project, studyToolWindow);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:14,代码来源:StudyToolWindowFactory.java

示例13: createToolWindowContent

import com.intellij.openapi.wm.ToolWindow; //导入方法依赖的package包/类
@Override
public void createToolWindowContent(@NotNull final Project project, @NotNull final ToolWindow toolWindow) {
  toolWindow.setIcon(InteractiveLearningIcons.CourseProgress);
  JPanel contentPanel = new JPanel();
  StudyTaskManager taskManager = StudyTaskManager.getInstance(project);
  if (taskManager.getCourse() != null) {
    contentPanel.setLayout(new BoxLayout(contentPanel, BoxLayout.PAGE_AXIS));
    contentPanel.add(Box.createRigidArea(new Dimension(10, 0)));

    Course course = taskManager.getCourse();
    if (course == null) {
      return;
    }
    int taskNum = 0;
    int taskSolved = 0;
    List<Lesson> lessons = course.getLessons();
    for (Lesson lesson : lessons) {
      if (lesson.getName().equals(EduNames.PYCHARM_ADDITIONAL)) continue;
      taskNum += lesson.getTaskList().size();
      taskSolved += getSolvedTasks(lesson, taskManager);
    }
    String completedTasks = String.format("%d of %d tasks completed", taskSolved, taskNum);

    double percent = (taskSolved * 100.0) / taskNum;
    contentPanel.add(Box.createRigidArea(new Dimension(0, 10)));
    StudyProgressBar studyProgressBar = new StudyProgressBar(percent / 100, 40, 10);
    contentPanel.add(studyProgressBar);
    contentPanel.add(Box.createRigidArea(new Dimension(0, 10)));
    addStatistics(completedTasks, contentPanel);
    contentPanel.setPreferredSize(new Dimension(100, 50));
    ContentFactory contentFactory = ContentFactory.SERVICE.getInstance();
    Content content = contentFactory.createContent(contentPanel, "", false);
    contentPanel.setMinimumSize(new Dimension(300, 100));
    toolWindow.getContentManager().addContent(content);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:37,代码来源:StudyProgressToolWindowFactory.java

示例14: CoverageViewManager

import com.intellij.openapi.wm.ToolWindow; //导入方法依赖的package包/类
public CoverageViewManager(Project project, ToolWindowManager toolWindowManager, CoverageDataManager dataManager) {
  myProject = project;
  myDataManager = dataManager;

  ToolWindow toolWindow = toolWindowManager.registerToolWindow(TOOLWINDOW_ID, true, ToolWindowAnchor.RIGHT, myProject, true);
  toolWindow.setIcon(AllIcons.Toolwindows.ToolWindowCoverage);
  toolWindow.setSplitMode(true, null);
  myContentManager = toolWindow.getContentManager();
  new ContentManagerWatcher(toolWindow, myContentManager);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:11,代码来源:CoverageViewManager.java

示例15: processConsole

import com.intellij.openapi.wm.ToolWindow; //导入方法依赖的package包/类
private static void processConsole(Project project, ProcessHandler processHandler) {
        ConsoleView consoleView = TextConsoleBuilderFactory.getInstance().createBuilder(project).getConsole();
        consoleView.clear();
        consoleView.attachToProcess(processHandler);
        processHandler.startNotify();

        ToolWindowManager toolWindowManager = ToolWindowManager.getInstance(project);
        ToolWindow toolWindow;
        toolWindow = toolWindowManager.getToolWindow(TOOL_ID);

        // if already exist tool window then show it
        if (toolWindow != null) {
            toolWindow.show(null);// TODO add more tabs here?
            return;
        }

        toolWindow = toolWindowManager.registerToolWindow(TOOL_ID, true, ToolWindowAnchor.BOTTOM);
        toolWindow.setTitle("Android....");
        toolWindow.setStripeTitle("Android Console");
        toolWindow.setShowStripeButton(true);
        toolWindow.setIcon(PluginIcons.ICON_TOOL_WINDOW);

        JPanel panel = new JPanel((LayoutManager) new BorderLayout());
        panel.add((Component) consoleView.getComponent(), "Center");

        // Create toolbars
        DefaultActionGroup toolbarActions = new DefaultActionGroup();
        AnAction[]
                consoleActions = consoleView.createConsoleActions();// 必须在 consoleView.getComponent() 调用后组件真正初始化之后调用
        toolbarActions.addAll((AnAction[]) Arrays.copyOf(consoleActions, consoleActions.length));
        toolbarActions.add((AnAction) new StopProcessAction("Stop process", "Stop process", processHandler));
//        toolbarActions.add((AnAction) new CloseAction(defaultExecutor, runDescriptor, project));


        ActionToolbar toolbar = ActionManager.getInstance().createActionToolbar("unknown", (ActionGroup) toolbarActions, false);
        toolbar.setTargetComponent(consoleView.getComponent());
        panel.add((Component) toolbar.getComponent(), "West");

        ContentImpl consoleContent = new ContentImpl(panel, "Build", false);
        consoleContent.setManager(toolWindow.getContentManager());

        toolbarActions.add(new CloseTabAction(consoleContent));

//        addAdditionalConsoleEditorActions(consoleView, consoleContent);
//        consoleComponent.setActions();
        toolWindow.getContentManager().addContent(consoleContent);
        toolWindow.getContentManager().addContent(new ContentImpl(new JButton("Test"), "Build2", false));
        toolWindow.show(null);
    }
 
开发者ID:beansoftapp,项目名称:react-native-console,代码行数:50,代码来源:RNUtil.java


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