Search in sources :

Example 6 with SimpleToolWindowPanel

use of com.intellij.openapi.ui.SimpleToolWindowPanel in project freeline by alibaba.

the class FreelineTerminal method createTerminalInContentPanel.

/**
 * 创建Terminal panel
 *
 * @param terminalRunner
 * @param toolWindow
 * @return
 */
private Content createTerminalInContentPanel(@NotNull AbstractTerminalRunner terminalRunner, @NotNull final ToolWindow toolWindow) {
    SimpleToolWindowPanel panel = new SimpleToolWindowPanel(false, true);
    Content content = ContentFactory.SERVICE.getInstance().createContent(panel, "", false);
    content.setCloseable(true);
    myTerminalWidget = terminalRunner.createTerminalWidget(content);
    panel.setContent(myTerminalWidget.getComponent());
    panel.addFocusListener(this);
    ActionToolbar toolbar = createToolbar(terminalRunner, myTerminalWidget, toolWindow);
    toolbar.setTargetComponent(panel);
    panel.setToolbar(toolbar.getComponent());
    content.setPreferredFocusableComponent(myTerminalWidget.getComponent());
    return content;
}
Also used : Content(com.intellij.ui.content.Content) SimpleToolWindowPanel(com.intellij.openapi.ui.SimpleToolWindowPanel) ActionToolbar(com.intellij.openapi.actionSystem.ActionToolbar)

Example 7 with SimpleToolWindowPanel

use of com.intellij.openapi.ui.SimpleToolWindowPanel in project intellij-community by JetBrains.

the class ChangesViewManager method createChangeViewComponent.

private JComponent createChangeViewComponent() {
    SimpleToolWindowPanel panel = new SimpleToolWindowPanel(false, true);
    EmptyAction.registerWithShortcutSet("ChangesView.Refresh", CommonShortcuts.getRerun(), panel);
    EmptyAction.registerWithShortcutSet("ChangesView.NewChangeList", CommonShortcuts.getNew(), panel);
    EmptyAction.registerWithShortcutSet("ChangesView.RemoveChangeList", CommonShortcuts.getDelete(), panel);
    EmptyAction.registerWithShortcutSet(IdeActions.MOVE_TO_ANOTHER_CHANGE_LIST, CommonShortcuts.getMove(), panel);
    EmptyAction.registerWithShortcutSet("ChangesView.Rename", CommonShortcuts.getRename(), panel);
    EmptyAction.registerWithShortcutSet("ChangesView.SetDefault", new CustomShortcutSet(KeyStroke.getKeyStroke(KeyEvent.VK_U, InputEvent.ALT_DOWN_MASK | ctrlMask())), panel);
    EmptyAction.registerWithShortcutSet("ChangesView.Diff", CommonShortcuts.getDiff(), panel);
    DefaultActionGroup group = (DefaultActionGroup) ActionManager.getInstance().getAction("ChangesViewToolbar");
    ActionToolbar toolbar = ActionManager.getInstance().createActionToolbar(ActionPlaces.CHANGES_VIEW_TOOLBAR, group, false);
    toolbar.setTargetComponent(myView);
    JComponent toolbarComponent = toolbar.getComponent();
    JPanel toolbarPanel = new JPanel(new BorderLayout());
    toolbarPanel.add(toolbarComponent, BorderLayout.WEST);
    DefaultActionGroup visualActionsGroup = new DefaultActionGroup();
    final Expander expander = new Expander();
    visualActionsGroup.add(CommonActionsManager.getInstance().createExpandAllAction(expander, panel));
    visualActionsGroup.add(CommonActionsManager.getInstance().createCollapseAllAction(expander, panel));
    ToggleShowFlattenAction showFlattenAction = new ToggleShowFlattenAction();
    showFlattenAction.registerCustomShortcutSet(new CustomShortcutSet(KeyStroke.getKeyStroke(KeyEvent.VK_P, ctrlMask())), panel);
    visualActionsGroup.add(showFlattenAction);
    visualActionsGroup.add(ActionManager.getInstance().getAction(IdeActions.ACTION_COPY));
    visualActionsGroup.add(new ToggleShowIgnoredAction());
    visualActionsGroup.add(new IgnoredSettingsAction());
    visualActionsGroup.add(new ToggleDetailsAction());
    visualActionsGroup.add(new ContextHelpAction(ChangesListView.HELP_ID));
    toolbarPanel.add(ActionManager.getInstance().createActionToolbar(ActionPlaces.CHANGES_VIEW_TOOLBAR, visualActionsGroup, false).getComponent(), BorderLayout.CENTER);
    myView.setMenuActions((DefaultActionGroup) ActionManager.getInstance().getAction("ChangesViewPopupMenu"));
    myView.setShowFlatten(myState.myShowFlatten);
    myProgressLabel = new JPanel(new BorderLayout());
    panel.setToolbar(toolbarPanel);
    final JPanel content = new JPanel(new BorderLayout());
    mySplitter = new JBSplitter(false, "ChangesViewManager.DETAILS_SPLITTER_PROPORTION", 0.5f);
    mySplitter.setHonorComponentsMinimumSize(false);
    final JScrollPane scrollPane = ScrollPaneFactory.createScrollPane(myView);
    final JPanel wrapper = new JPanel(new BorderLayout());
    wrapper.add(scrollPane, BorderLayout.CENTER);
    mySplitter.setFirstComponent(wrapper);
    content.add(mySplitter, BorderLayout.CENTER);
    content.add(myProgressLabel, BorderLayout.SOUTH);
    panel.setContent(content);
    ChangesDnDSupport.install(myProject, myView);
    myView.addTreeSelectionListener(myTsl);
    return panel;
}
Also used : TreeExpander(com.intellij.ide.TreeExpander) SimpleToolWindowPanel(com.intellij.openapi.ui.SimpleToolWindowPanel) ContextHelpAction(com.intellij.ide.actions.ContextHelpAction) IgnoredSettingsAction(com.intellij.openapi.vcs.changes.actions.IgnoredSettingsAction)

Example 8 with SimpleToolWindowPanel

use of com.intellij.openapi.ui.SimpleToolWindowPanel in project intellij-community by JetBrains.

the class DynamicToolWindowWrapper method buildBigPanel.

private JPanel buildBigPanel() {
    myBigPanel = new SimpleToolWindowPanel(true);
    myBigPanel.setBackground(UIUtil.getFieldForegroundColor());
    final JPanel panel = new JPanel(new BorderLayout());
    myBigPanel.add(panel, BorderLayout.CENTER);
    myTreeTablePanel = new JPanel(new BorderLayout());
    rebuildTreePanel();
    panel.add(myTreeTablePanel);
    myBigPanel.setPreferredSize(new Dimension(200, myBigPanel.getHeight()));
    final ActionManager actionManager = ActionManager.getInstance();
    final ActionGroup actionGroup = (ActionGroup) actionManager.getAction("Groovy.Dynamic.Toolbar");
    ActionToolbar actionToolbar = actionManager.createActionToolbar("Groovy.Dynamic.Toolbar", actionGroup, true);
    myBigPanel.setToolbar(actionToolbar.getComponent());
    myBigPanel.revalidate();
    return myBigPanel;
}
Also used : SimpleToolWindowPanel(com.intellij.openapi.ui.SimpleToolWindowPanel)

Example 9 with SimpleToolWindowPanel

use of com.intellij.openapi.ui.SimpleToolWindowPanel in project intellij-community by JetBrains.

the class ConsoleManager method createConsole.

private void createConsole(@NotNull final NetService netService) {
    TextConsoleBuilder consoleBuilder = TextConsoleBuilderFactory.getInstance().createBuilder(netService.getProject());
    netService.configureConsole(consoleBuilder);
    console = consoleBuilder.getConsole();
    ApplicationManager.getApplication().invokeLater(() -> {
        ActionGroup actionGroup = netService.getConsoleToolWindowActions();
        ActionToolbar toolbar = ActionManager.getInstance().createActionToolbar(ActionPlaces.UNKNOWN, actionGroup, false);
        SimpleToolWindowPanel toolWindowPanel = new SimpleToolWindowPanel(false, true);
        toolWindowPanel.setContent(console.getComponent());
        toolWindowPanel.setToolbar(toolbar.getComponent());
        ToolWindow toolWindow = ToolWindowManager.getInstance(netService.getProject()).registerToolWindow(netService.getConsoleToolWindowId(), false, ToolWindowAnchor.BOTTOM, netService.getProject(), true);
        toolWindow.setIcon(netService.getConsoleToolWindowIcon());
        Content content = ContentFactory.SERVICE.getInstance().createContent(toolWindowPanel, "", false);
        Disposer.register(content, console);
        toolWindow.getContentManager().addContent(content);
    }, netService.getProject().getDisposed());
}
Also used : ToolWindow(com.intellij.openapi.wm.ToolWindow) TextConsoleBuilder(com.intellij.execution.filters.TextConsoleBuilder) ActionGroup(com.intellij.openapi.actionSystem.ActionGroup) Content(com.intellij.ui.content.Content) ActionToolbar(com.intellij.openapi.actionSystem.ActionToolbar) SimpleToolWindowPanel(com.intellij.openapi.ui.SimpleToolWindowPanel)

Example 10 with SimpleToolWindowPanel

use of com.intellij.openapi.ui.SimpleToolWindowPanel in project intellij-community by JetBrains.

the class PythonConsoleToolWindow method createContent.

private static Content createContent(@NotNull final RunContentDescriptor contentDescriptor) {
    SimpleToolWindowPanel panel = new SimpleToolWindowPanel(false, true);
    Content content = ContentFactory.SERVICE.getInstance().createContent(panel, contentDescriptor.getDisplayName(), false);
    content.setCloseable(true);
    resetContent(contentDescriptor, panel, content);
    return content;
}
Also used : Content(com.intellij.ui.content.Content) SimpleToolWindowPanel(com.intellij.openapi.ui.SimpleToolWindowPanel)

Aggregations

SimpleToolWindowPanel (com.intellij.openapi.ui.SimpleToolWindowPanel)12 Content (com.intellij.ui.content.Content)8 ToolWindow (com.intellij.openapi.wm.ToolWindow)3 ContentManager (com.intellij.ui.content.ContentManager)3 TextConsoleBuilder (com.intellij.execution.filters.TextConsoleBuilder)2 ConsoleView (com.intellij.execution.ui.ConsoleView)2 ActionToolbar (com.intellij.openapi.actionSystem.ActionToolbar)2 ProcessAdapter (com.intellij.execution.process.ProcessAdapter)1 ProcessEvent (com.intellij.execution.process.ProcessEvent)1 JBRunnerTabs (com.intellij.execution.ui.layout.impl.JBRunnerTabs)1 TreeExpander (com.intellij.ide.TreeExpander)1 ContextHelpAction (com.intellij.ide.actions.ContextHelpAction)1 ActionGroup (com.intellij.openapi.actionSystem.ActionGroup)1 Editor (com.intellij.openapi.editor.Editor)1 EditorEx (com.intellij.openapi.editor.ex.EditorEx)1 IgnoredSettingsAction (com.intellij.openapi.vcs.changes.actions.IgnoredSettingsAction)1 ToolWindowManager (com.intellij.openapi.wm.ToolWindowManager)1 JBLabel (com.intellij.ui.components.JBLabel)1 TabbedContentAction (com.intellij.ui.content.tabs.TabbedContentAction)1 AbstractLayoutManager (com.intellij.util.ui.AbstractLayoutManager)1