Search in sources :

Example 6 with ActionToolbar

use of com.intellij.openapi.actionSystem.ActionToolbar in project google-cloud-intellij by GoogleCloudPlatform.

the class GcsToolWindowPanel method createToolbar.

private JPanel createToolbar() {
    DefaultActionGroup group = new DefaultActionGroup();
    group.add(new RefreshAction());
    ActionToolbar actionToolBar = ActionManager.getInstance().createActionToolbar(GCS_PANEL_TOOLBAR_ACTION, group, true);
    return JBUI.Panels.simplePanel(actionToolBar.getComponent());
}
Also used : ActionToolbar(com.intellij.openapi.actionSystem.ActionToolbar) DefaultActionGroup(com.intellij.openapi.actionSystem.DefaultActionGroup)

Example 7 with ActionToolbar

use of com.intellij.openapi.actionSystem.ActionToolbar in project google-cloud-intellij by GoogleCloudPlatform.

the class CloudDebugHistoricalSnapshotsTest method setUp.

@Before
public void setUp() {
    MockApplication application = new MyMockApplicationEx(parent);
    ActionManagerEx manager = Mockito.mock(ActionManagerEx.class);
    ActionToolbar actionToolbar = Mockito.mock(ActionToolbar.class);
    Mockito.when(actionToolbar.getComponent()).thenReturn(new JComponent() {
    });
    Mockito.when(manager.createActionToolbar(Mockito.anyString(), Mockito.any(ActionGroup.class), Mockito.anyBoolean())).thenReturn(actionToolbar);
    Mockito.when(manager.createActionToolbar(Mockito.anyString(), Mockito.any(ActionGroup.class), Mockito.anyBoolean(), Mockito.anyBoolean())).thenReturn(actionToolbar);
    application.addComponent(ActionManager.class, manager);
    application.registerService(UISettings.class);
    ApplicationManager.setApplication(application, parent);
    XDebugSession session = Mockito.mock(XDebugSession.class);
    Mockito.when(handler.getProcess()).thenReturn(mockProcess);
    Mockito.when(mockProcess.getXDebugSession()).thenReturn(session);
}
Also used : XDebugSession(com.intellij.xdebugger.XDebugSession) MockApplication(com.intellij.mock.MockApplication) ActionGroup(com.intellij.openapi.actionSystem.ActionGroup) JComponent(javax.swing.JComponent) ActionToolbar(com.intellij.openapi.actionSystem.ActionToolbar) ActionManagerEx(com.intellij.openapi.actionSystem.ex.ActionManagerEx) Before(org.junit.Before)

Example 8 with ActionToolbar

use of com.intellij.openapi.actionSystem.ActionToolbar 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 9 with ActionToolbar

use of com.intellij.openapi.actionSystem.ActionToolbar in project android by JetBrains.

the class ProjectProfileSelectionDialog method createTreePanel.

@NotNull
static JPanel createTreePanel(@NotNull CheckboxTreeView tree) {
    JPanel treePanel = new JPanel(new BorderLayout());
    DefaultActionGroup group = new DefaultActionGroup();
    CommonActionsManager actions = CommonActionsManager.getInstance();
    group.addAll(actions.createExpandAllAction(tree, treePanel), actions.createCollapseAllAction(tree, treePanel));
    ActionToolbar actionToolBar = ActionManager.getInstance().createActionToolbar("AndroidProjectProfileSelection", group, true);
    JPanel buttonsPanel = new JPanel(new BorderLayout());
    buttonsPanel.add(actionToolBar.getComponent(), BorderLayout.CENTER);
    buttonsPanel.setBorder(new SideBorder(JBColor.border(), SideBorder.TOP | SideBorder.LEFT | SideBorder.RIGHT, 1));
    treePanel.add(buttonsPanel, BorderLayout.NORTH);
    treePanel.add(ScrollPaneFactory.createScrollPane(tree), BorderLayout.CENTER);
    return treePanel;
}
Also used : CommonActionsManager(com.intellij.ide.CommonActionsManager) ActionToolbar(com.intellij.openapi.actionSystem.ActionToolbar) DefaultActionGroup(com.intellij.openapi.actionSystem.DefaultActionGroup) NotNull(org.jetbrains.annotations.NotNull)

Example 10 with ActionToolbar

use of com.intellij.openapi.actionSystem.ActionToolbar in project intellij-plugins by JetBrains.

the class IDEtalkMessagesWindowImpl method createToolWindowComponent.

@Override
protected void createToolWindowComponent() {
    myContentFactory = ContentFactory.SERVICE.getInstance();
    TabbedPaneContentUI contentUI = new TabbedPaneContentUI(SwingConstants.TOP);
    myContentManager = myContentFactory.createContentManager(contentUI, true, myProject);
    try {
        myTabsWrapper = getWrapper(contentUI);
    } catch (IllegalAccessException e) {
        throw new RuntimeException(e);
    }
    myContentManager.addContentManagerListener(new ContentManagerAdapter() {

        @Override
        public void selectionChanged(ContentManagerEvent event) {
            super.selectionChanged(event);
            // Process tab switching:
            UIUtil.invokeLater(() -> processMessagesOfVisibleTab());
        }
    });
    myPanel = new NonOpaquePanel(new BorderLayout());
    UIUtil.runWhenShown(myPanel, () -> showAllTabsOfUsersWithMessages());
    myPanel.add(myContentManager.getComponent());
    AnAction toolbarGroup = myActionManager.getAction("IDEtalk.MessageWindowToolbar");
    if (toolbarGroup != null) {
        ActionToolbar toolbar = myActionManager.createActionToolbar(PLACE_TOOLBAR, (ActionGroup) toolbarGroup, false);
        myPanel.add(toolbar.getComponent(), BorderLayout.WEST);
    }
}
Also used : NonOpaquePanel(com.intellij.ui.components.panels.NonOpaquePanel) ActionToolbar(com.intellij.openapi.actionSystem.ActionToolbar) AnAction(com.intellij.openapi.actionSystem.AnAction)

Aggregations

ActionToolbar (com.intellij.openapi.actionSystem.ActionToolbar)19 DefaultActionGroup (com.intellij.openapi.actionSystem.DefaultActionGroup)10 ActionGroup (com.intellij.openapi.actionSystem.ActionGroup)5 ActionManager (com.intellij.openapi.actionSystem.ActionManager)4 Content (com.intellij.ui.content.Content)4 ToolWindow (com.intellij.openapi.wm.ToolWindow)3 SimpleToolWindowPanel (com.intellij.openapi.ui.SimpleToolWindowPanel)2 NotNull (org.jetbrains.annotations.NotNull)2 TextConsoleBuilder (com.intellij.execution.filters.TextConsoleBuilder)1 ConsoleViewContentType (com.intellij.execution.ui.ConsoleViewContentType)1 CommonActionsManager (com.intellij.ide.CommonActionsManager)1 NextOccurenceToolbarAction (com.intellij.ide.actions.NextOccurenceToolbarAction)1 PreviousOccurenceToolbarAction (com.intellij.ide.actions.PreviousOccurenceToolbarAction)1 MockApplication (com.intellij.mock.MockApplication)1 AnAction (com.intellij.openapi.actionSystem.AnAction)1 ActionManagerEx (com.intellij.openapi.actionSystem.ex.ActionManagerEx)1 ComboBox (com.intellij.openapi.ui.ComboBox)1 CommittedChangeList (com.intellij.openapi.vcs.versionBrowser.CommittedChangeList)1 ToolWindowManager (com.intellij.openapi.wm.ToolWindowManager)1 HorizontalLayout (com.intellij.ui.components.panels.HorizontalLayout)1