Java Code Examples for com.intellij.openapi.wm.ToolWindow#setStripeTitle()

The following examples show how to use com.intellij.openapi.wm.ToolWindow#setStripeTitle() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: FreelineUtil.java    From freeline with BSD 3-Clause "New" or "Revised" License 7 votes vote down vote up
private static void processConsole(Project project, ProcessHandler processHandler) {
    ConsoleView consoleView = FreeUIManager.getInstance(project).getConsoleView(project);
    consoleView.clear();
    consoleView.attachToProcess(processHandler);

    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);
        return;
    }

    toolWindow = toolWindowManager.registerToolWindow(TOOL_ID, true, ToolWindowAnchor.BOTTOM);
    toolWindow.setTitle("free....");
    toolWindow.setStripeTitle("Free Console");
    toolWindow.setShowStripeButton(true);
    toolWindow.setIcon(PluginIcons.ICON_TOOL_WINDOW);
    toolWindow.getContentManager().addContent(new ContentImpl(consoleView.getComponent(), "Build", true));
    toolWindow.show(null);
}
 
Example 2
Source File: ReactNativeConsole.java    From react-native-console with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
/**
     * Init and show this console pane.
     * @param toolWindow
     */
    public void init(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(" - ");
        // TODO Change to Eventbus
        ((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) {
                        init(window);
                    }
                }
            }
        });
        toolWindow.show(null);
    }
 
Example 3
Source File: FreelineTerminal.java    From freeline with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
public void initTerminal(final ToolWindow toolWindow) {
    toolWindow.setToHideOnEmptyContent(true);
    LocalTerminalDirectRunner terminalRunner = LocalTerminalDirectRunner.createTerminalRunner(myProject);
    toolWindow.setStripeTitle("Freeline");
    Content content = createTerminalInContentPanel(terminalRunner, toolWindow);
    toolWindow.getContentManager().addContent(content);
    toolWindow.setShowStripeButton(true);
    toolWindow.setTitle("Console");
    ((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(FreelineToolWindowFactory.TOOL_WINDOW_ID);
            if (window != null) {
                boolean visible = window.isVisible();
                if (visible && toolWindow.getContentManager().getContentCount() == 0) {
                    initTerminal(window);
                }
            }
        }
    });
    toolWindow.show(null);
    JBTabbedTerminalWidget terminalWidget = getTerminalWidget(toolWindow);
    if (terminalWidget != null && terminalWidget.getCurrentSession() != null) {
        Terminal terminal = terminalWidget.getCurrentSession().getTerminal();
        if (terminal != null) {
            terminal.setCursorVisible(false);
        }
    }
}
 
Example 4
Source File: BlazeConsoleToolWindowFactory.java    From intellij with Apache License 2.0 5 votes vote down vote up
@Override
public void createToolWindowContent(@NotNull Project project, @NotNull ToolWindow toolWindow) {
  String title = Blaze.buildSystemName(project) + " Console";
  toolWindow.setTitle(title);
  toolWindow.setStripeTitle(title);
  BlazeConsoleView.getInstance(project).createToolWindowContent(toolWindow);
}
 
Example 5
Source File: RNUtil.java    From react-native-console with BSD 3-Clause "New" or "Revised" License 4 votes vote down vote up
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);
    }
 
Example 6
Source File: ORToolWindowFactory.java    From reasonml-idea-plugin with MIT License 4 votes vote down vote up
@Override
public void init(ToolWindow window) {
    window.setIcon(getIcon());
    window.setTitle(getTitle());
    window.setStripeTitle(getStripeTitle());
}