Search in sources :

Example 1 with ActionToolbar

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

the class DiffSplitter method createActionComponent.

@Nullable
private static JComponent createActionComponent(@Nullable final AnAction action) {
    if (action == null)
        return null;
    ActionToolbar toolbar = ActionManager.getInstance().createActionToolbar("", new DefaultActionGroup(action), true);
    toolbar.setReservePlaceAutoPopupIcon(false);
    toolbar.getComponent().setCursor(Cursor.getDefaultCursor());
    return toolbar.getComponent();
}
Also used : ActionToolbar(com.intellij.openapi.actionSystem.ActionToolbar) DefaultActionGroup(com.intellij.openapi.actionSystem.DefaultActionGroup) Nullable(org.jetbrains.annotations.Nullable)

Example 2 with ActionToolbar

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

the class NlPreviewFixture method getConfigToolbar.

@NotNull
public NlConfigurationToolbarFixture getConfigToolbar() {
    ActionToolbar toolbar = myRobot.finder().findByName("NlConfigToolbar", ActionToolbarImpl.class, false);
    Wait.seconds(1).expecting("Configuration toolbar to be showing").until(() -> toolbar.getComponent().isShowing());
    return new NlConfigurationToolbarFixture(myRobot, GuiTests.waitUntilShowing(myRobot, Matchers.byType(DesignSurface.class)), toolbar);
}
Also used : ActionToolbar(com.intellij.openapi.actionSystem.ActionToolbar) NotNull(org.jetbrains.annotations.NotNull)

Example 3 with ActionToolbar

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

the class GradleToolWindowPanel method initContent.

public void initContent() {
    final ActionManager actionManager = ActionManager.getInstance();
    final ActionGroup actionGroup = (ActionGroup) actionManager.getAction(TOOL_WINDOW_TOOLBAR_ID);
    ActionToolbar actionToolbar = actionManager.createActionToolbar(myPlace, actionGroup, true);
    JPanel toolbarControl = new JPanel(new GridBagLayout());
    GridBagConstraints constraints = new GridBagConstraints();
    constraints.gridwidth = GridBagConstraints.REMAINDER;
    constraints.weightx = 1;
    constraints.fill = GridBagConstraints.HORIZONTAL;
    constraints.anchor = GridBagConstraints.WEST;
    toolbarControl.add(actionToolbar.getComponent(), constraints);
    for (JComponent component : getToolbarControls()) {
        component.setBorder(IdeBorderFactory.createBorder(SideBorder.TOP));
        toolbarControl.add(component, constraints);
    }
    setToolbar(toolbarControl);
    final JComponent payloadControl = buildContent();
    JScrollPane scrollPane = ScrollPaneFactory.createScrollPane(payloadControl);
    JScrollBar scrollBar = scrollPane.getVerticalScrollBar();
    myContent.add(scrollPane, CONTENT_CARD_NAME);
    RichTextControlBuilder builder = new RichTextControlBuilder();
    builder.setBackgroundColor(payloadControl.getBackground());
    builder.setForegroundColor(UIUtil.getInactiveTextColor());
    builder.setFont(payloadControl.getFont());
    builder.setText(GradleBundle.message("gradle.toolwindow.text.no.linked.project"));
    final JComponent noLinkedProjectControl = builder.build();
    myContent.add(noLinkedProjectControl, NON_LINKED_CARD_NAME);
    update();
}
Also used : ActionManager(com.intellij.openapi.actionSystem.ActionManager) ActionGroup(com.intellij.openapi.actionSystem.ActionGroup) RichTextControlBuilder(org.jetbrains.plugins.gradle.ui.RichTextControlBuilder) ActionToolbar(com.intellij.openapi.actionSystem.ActionToolbar)

Example 4 with ActionToolbar

use of com.intellij.openapi.actionSystem.ActionToolbar in project evosuite by EvoSuite.

the class ProjectRegistration method projectOpened.

@Override
public void projectOpened() {
    EvoParameters.getInstance().load(project);
    ActionManager am = ActionManager.getInstance();
    // create the tool window, which will appear in the bottom when an EvoSuite run is started
    ToolWindowManager toolWindowManager = ToolWindowManager.getInstance(project);
    ToolWindow toolWindow = toolWindowManager.registerToolWindow("EvoSuite", false, ToolWindowAnchor.BOTTOM);
    toolWindow.setTitle("EvoSuite Console Output");
    toolWindow.setType(ToolWindowType.DOCKED, null);
    // create a console panel
    console = (ConsoleViewImpl) TextConsoleBuilderFactory.getInstance().createBuilder(project).getConsole();
    ContentFactory contentFactory = ContentFactory.SERVICE.getInstance();
    JComponent consolePanel = console.getComponent();
    IntelliJNotifier notifier = IntelliJNotifier.registerNotifier(project, "EvoSuite Plugin", console);
    // create left-toolbar with stop button
    DefaultActionGroup buttonGroup = new DefaultActionGroup();
    buttonGroup.add(new StopEvoAction(notifier));
    ActionToolbar viewToolbar = am.createActionToolbar("EvoSuite.ConsoleToolbar", buttonGroup, false);
    JComponent toolBarPanel = viewToolbar.getComponent();
    JPanel panel = new JPanel();
    panel.setLayout(new BorderLayout());
    panel.add(toolBarPanel, BorderLayout.WEST);
    panel.add(consolePanel, BorderLayout.CENTER);
    // Content content = contentFactory.createContent(consolePanel, "", false);
    Content content = contentFactory.createContent(panel, "", false);
    toolWindow.getContentManager().addContent(content);
}
Also used : ActionManager(com.intellij.openapi.actionSystem.ActionManager) ToolWindow(com.intellij.openapi.wm.ToolWindow) Content(com.intellij.ui.content.Content) ToolWindowManager(com.intellij.openapi.wm.ToolWindowManager) ActionToolbar(com.intellij.openapi.actionSystem.ActionToolbar) DefaultActionGroup(com.intellij.openapi.actionSystem.DefaultActionGroup) ContentFactory(com.intellij.ui.content.ContentFactory)

Example 5 with ActionToolbar

use of com.intellij.openapi.actionSystem.ActionToolbar in project intellij by bazelbuild.

the class BlazeProblemsViewPanel method createToolbarPanel.

/**
 * A custom toolbar panel, without most of the irrelevant built-in items.
 */
private JComponent createToolbarPanel() {
    DefaultActionGroup group = new DefaultActionGroup();
    // NOTYPO
    group.add(new PreviousOccurenceToolbarAction(this));
    // NOTYPO
    group.add(new NextOccurenceToolbarAction(this));
    fillRightToolbarGroup(group);
    ActionToolbar toolbar = ActionManager.getInstance().createActionToolbar(ActionPlaces.COMPILER_MESSAGES_TOOLBAR, group, false);
    return toolbar.getComponent();
}
Also used : NextOccurenceToolbarAction(com.intellij.ide.actions.NextOccurenceToolbarAction) ActionToolbar(com.intellij.openapi.actionSystem.ActionToolbar) DefaultActionGroup(com.intellij.openapi.actionSystem.DefaultActionGroup) PreviousOccurenceToolbarAction(com.intellij.ide.actions.PreviousOccurenceToolbarAction)

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