Search in sources :

Example 11 with ActionToolbar

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

the class IDEtalkToolWindow method createToolbar.

private ActionToolbar createToolbar(final ActionGroup toolbarActions) {
    final ActionToolbar toolbar = myActionManager.createActionToolbar(PLACE_TOOLBAR, toolbarActions, true);
    toolbar.setLayoutPolicy(ActionToolbar.NOWRAP_LAYOUT_POLICY);
    return toolbar;
}
Also used : ActionToolbar(com.intellij.openapi.actionSystem.ActionToolbar)

Example 12 with ActionToolbar

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

the class StatusToolbarImpl method createBottomPanel.

private Component createBottomPanel() {
    DefaultActionGroup actions = new DefaultActionGroup();
    for (Class<? extends NamedUserCommand> toolbarAction : getToolbarActions()) {
        actions.add(new BaseAction(toolbarAction));
    }
    final ActionToolbar actionToolbar = ActionManager.getInstance().createActionToolbar("BottomToolbar", actions, true);
    actionToolbar.setLayoutPolicy(ActionToolbar.NOWRAP_LAYOUT_POLICY);
    return actionToolbar.getComponent();
}
Also used : BaseAction(jetbrains.communicator.idea.actions.BaseAction) ActionToolbar(com.intellij.openapi.actionSystem.ActionToolbar) DefaultActionGroup(com.intellij.openapi.actionSystem.DefaultActionGroup)

Example 13 with ActionToolbar

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

the class NlActionsToolbar method createToolbarComponent.

private JComponent createToolbarComponent() {
    JPanel panel = new JPanel(new BorderLayout());
    panel.setBorder(IdeBorderFactory.createBorder(SideBorder.BOTTOM));
    // Create a layout where there are three toolbars:
    // +----------------------------------------------------------------------------+
    // | Normal toolbar, minus dynamic actions                                      |
    // +---------------------------------------------+------------------------------+
    // | Dynamic layout actions                      | Zoom actions and file status |
    // +---------------------------------------------+------------------------------+
    ConfigurationHolder context = new NlEditorPanel.NlConfigurationHolder(mySurface);
    ActionGroup configGroup = createConfigActions(context, mySurface);
    ActionManager actionManager = ActionManager.getInstance();
    myActionToolbar = actionManager.createActionToolbar("NlConfigToolbar", configGroup, true);
    myActionToolbar.getComponent().setName("NlConfigToolbar");
    myActionToolbar.setLayoutPolicy(ActionToolbar.WRAP_LAYOUT_POLICY);
    JComponent actionToolbarComponent = myActionToolbar.getComponent();
    actionToolbarComponent.setBorder(IdeBorderFactory.createBorder(SideBorder.BOTTOM));
    panel.add(actionToolbarComponent, BorderLayout.NORTH);
    final ActionToolbar layoutToolBar = actionManager.createActionToolbar("NlLayoutToolbar", myDynamicGroup, true);
    layoutToolBar.getComponent().setName("NlLayoutToolbar");
    layoutToolBar.setLayoutPolicy(ActionToolbar.WRAP_LAYOUT_POLICY);
    JPanel bottom = new JPanel(new BorderLayout());
    bottom.add(layoutToolBar.getComponent(), BorderLayout.WEST);
    JPanel combined = new JPanel(new BorderLayout());
    ActionToolbar zoomToolBar = actionManager.createActionToolbar("NlRhsToolbar", getRhsActions(mySurface), true);
    combined.add(zoomToolBar.getComponent(), BorderLayout.WEST);
    bottom.add(combined, BorderLayout.EAST);
    panel.add(bottom, BorderLayout.SOUTH);
    mySurface.addListener(this);
    updateViewActions();
    return panel;
}
Also used : ActionManager(com.intellij.openapi.actionSystem.ActionManager) ActionGroup(com.intellij.openapi.actionSystem.ActionGroup) DefaultActionGroup(com.intellij.openapi.actionSystem.DefaultActionGroup) ActionToolbar(com.intellij.openapi.actionSystem.ActionToolbar)

Example 14 with ActionToolbar

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

the class IncomingChangesViewProvider method initContent.

public JComponent initContent() {
    myBrowser = new CommittedChangesTreeBrowser(myProject, Collections.<CommittedChangeList>emptyList());
    myBrowser.getEmptyText().setText(VcsBundle.message("incoming.changes.not.loaded.message"));
    ActionGroup group = (ActionGroup) ActionManager.getInstance().getAction("IncomingChangesToolbar");
    final ActionToolbar toolbar = myBrowser.createGroupFilterToolbar(myProject, group, null, Collections.<AnAction>emptyList());
    myBrowser.setToolBar(toolbar.getComponent());
    myBrowser.setTableContextMenu(group, Collections.<AnAction>emptyList());
    myConnection = myBus.connect();
    myConnection.subscribe(CommittedChangesCache.COMMITTED_TOPIC, new MyCommittedChangesListener());
    loadChangesToBrowser(false, true);
    return myBrowser;
}
Also used : ActionGroup(com.intellij.openapi.actionSystem.ActionGroup) CommittedChangeList(com.intellij.openapi.vcs.versionBrowser.CommittedChangeList) ActionToolbar(com.intellij.openapi.actionSystem.ActionToolbar)

Example 15 with ActionToolbar

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

the class ProjectLevelVcsManagerImpl method getOrCreateConsoleContent.

private Content getOrCreateConsoleContent(final ContentManager contentManager) {
    final String displayName = VcsBundle.message("vcs.console.toolwindow.display.name");
    Content content = contentManager.findContent(displayName);
    if (content == null) {
        releaseConsole();
        myConsole = TextConsoleBuilderFactory.getInstance().createBuilder(myProject).getConsole();
        JPanel panel = new JPanel(new BorderLayout());
        panel.add(myConsole.getComponent(), BorderLayout.CENTER);
        ActionToolbar toolbar = ActionManager.getInstance().createActionToolbar(ActionPlaces.UNKNOWN, new DefaultActionGroup(myConsole.createConsoleActions()), false);
        panel.add(toolbar.getComponent(), BorderLayout.WEST);
        content = ContentFactory.SERVICE.getInstance().createContent(panel, displayName, true);
        content.setDisposer(myConsoleDisposer);
        contentManager.addContent(content);
        for (Pair<String, ConsoleViewContentType> pair : myPendingOutput) {
            printToConsole(pair.first, pair.second);
        }
        myPendingOutput.clear();
    }
    return content;
}
Also used : Content(com.intellij.ui.content.Content) ActionToolbar(com.intellij.openapi.actionSystem.ActionToolbar) DefaultActionGroup(com.intellij.openapi.actionSystem.DefaultActionGroup) ConsoleViewContentType(com.intellij.execution.ui.ConsoleViewContentType)

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