Search in sources :

Example 1 with ActionToolbarImpl

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

the class SearchReplaceComponent method createReplaceToolbar1.

@NotNull
private ActionToolbarImpl createReplaceToolbar1(@NotNull DefaultActionGroup group) {
    ActionToolbarImpl toolbar = createToolbar(group);
    toolbar.setForceMinimumSize(true);
    toolbar.setReservePlaceAutoPopupIcon(false);
    return toolbar;
}
Also used : ActionToolbarImpl(com.intellij.openapi.actionSystem.impl.ActionToolbarImpl) NotNull(org.jetbrains.annotations.NotNull)

Example 2 with ActionToolbarImpl

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

the class FindPopupPanel method createToolbar.

public static ActionToolbarImpl createToolbar(AnAction... actions) {
    ActionToolbarImpl toolbar = (ActionToolbarImpl) ActionManager.getInstance().createActionToolbar(ActionPlaces.EDITOR_TOOLBAR, new DefaultActionGroup(actions), true);
    toolbar.setForceMinimumSize(true);
    toolbar.setLayoutPolicy(ActionToolbar.NOWRAP_LAYOUT_POLICY);
    return toolbar;
}
Also used : ActionToolbarImpl(com.intellij.openapi.actionSystem.impl.ActionToolbarImpl)

Example 3 with ActionToolbarImpl

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

the class XFramesView method createToolbar.

private ActionToolbarImpl createToolbar() {
    final DefaultActionGroup framesGroup = new DefaultActionGroup();
    CommonActionsManager actionsManager = CommonActionsManager.getInstance();
    framesGroup.add(actionsManager.createPrevOccurenceAction(myFramesList));
    framesGroup.add(actionsManager.createNextOccurenceAction(myFramesList));
    framesGroup.addAll(ActionManager.getInstance().getAction(XDebuggerActions.FRAMES_TOP_TOOLBAR_GROUP));
    final ActionToolbarImpl toolbar = (ActionToolbarImpl) ActionManager.getInstance().createActionToolbar(ActionPlaces.DEBUGGER_TOOLBAR, framesGroup, true);
    toolbar.setReservePlaceAutoPopupIcon(false);
    toolbar.setAddSeparatorFirst(true);
    toolbar.getComponent().setBorder(new EmptyBorder(1, 0, 0, 0));
    return toolbar;
}
Also used : ActionToolbarImpl(com.intellij.openapi.actionSystem.impl.ActionToolbarImpl) CommonActionsManager(com.intellij.ide.CommonActionsManager) EmptyBorder(javax.swing.border.EmptyBorder) DefaultActionGroup(com.intellij.openapi.actionSystem.DefaultActionGroup)

Example 4 with ActionToolbarImpl

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

the class MonitorPanel method setupToolbar.

@NotNull
private ActionToolbarImpl setupToolbar(@NotNull ActionGroup actions, @NotNull BaseMonitorView monitor) {
    DefaultActionGroup viewActions = new DefaultActionGroup();
    viewActions.addAll(actions);
    viewActions.add(new MonitorMoveAction(this, monitor, -1));
    viewActions.add(new MonitorMoveAction(this, monitor, 1));
    viewActions.add(new MinimizeAction(this, monitor));
    ActionToolbarImpl toolbar = new ActionToolbarImpl(ActionPlaces.UNKNOWN, viewActions, true, false, DataManager.getInstance(), ActionManagerEx.getInstanceEx(), KeymapManagerEx.getInstanceEx());
    toolbar.setBorder(BorderFactory.createEmptyBorder());
    toolbar.setMinimumSize(new Dimension(0, ActionToolbar.DEFAULT_MINIMUM_BUTTON_SIZE.height));
    toolbar.setPreferredSize(new Dimension(Integer.MAX_VALUE, ActionToolbar.DEFAULT_MINIMUM_BUTTON_SIZE.height));
    toolbar.setMaximumSize(toolbar.getPreferredSize());
    return toolbar;
}
Also used : ActionToolbarImpl(com.intellij.openapi.actionSystem.impl.ActionToolbarImpl) DefaultActionGroup(com.intellij.openapi.actionSystem.DefaultActionGroup) NotNull(org.jetbrains.annotations.NotNull)

Example 5 with ActionToolbarImpl

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

the class MonitorPanel method layoutMonitor.

private void layoutMonitor(@NotNull final JComponent monitorComponent, @NotNull ActionGroup actions, @NotNull BaseMonitorView monitor, int titleSize) {
    // Set a minimum size on the monitorComponent so that it doesn't squish when the container is made small.
    monitorComponent.setMinimumSize(new Dimension(100, 100));
    monitorComponent.setPreferredSize(new Dimension(Integer.MAX_VALUE, 100));
    int toolbarIndex = getToolbarIndex(monitor);
    assert toolbarIndex == getComponentCount();
    final int componentIndex = toolbarIndex + 1;
    // Create a blank panel to show when the view's component is minimized.
    final JPanel minimizedPanel = new JPanel();
    minimizedPanel.setBackground(monitor.getViewBackgroundColor());
    minimizedPanel.setMinimumSize(new Dimension(Integer.MAX_VALUE, 2));
    minimizedPanel.setPreferredSize(minimizedPanel.getMinimumSize());
    minimizedPanel.setMaximumSize(minimizedPanel.getMinimumSize());
    myHiddenMonitorLookup.put(monitorComponent, minimizedPanel);
    myHiddenMonitorLookup.put(minimizedPanel, monitorComponent);
    ActionToolbarImpl toolbar = setupToolbar(actions, monitor);
    JBLabel titleLabel = new JBLabel(monitor.getTitleName(), monitor.getTitleIcon(), SwingConstants.LEFT);
    Border border = BorderFactory.createEmptyBorder(0, 5, 0, 20);
    titleLabel.setBorder(border);
    titleLabel.setBackground(toolbar.getBackground());
    Insets borderInsets = border.getBorderInsets(titleLabel);
    titleLabel.setMinimumSize(new Dimension(titleSize + borderInsets.left + borderInsets.right, ActionToolbar.DEFAULT_MINIMUM_BUTTON_SIZE.height));
    titleLabel.setPreferredSize(titleLabel.getMinimumSize());
    titleLabel.setMaximumSize(titleLabel.getMinimumSize());
    JPanel titlePanel = new JPanel(new BorderLayout());
    titlePanel.add(titleLabel, BorderLayout.WEST);
    titlePanel.add(toolbar, BorderLayout.CENTER);
    GridBagConstraints titlePanelConstraints = new GridBagConstraints(0, toolbarIndex, 1, 1, 1.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0);
    add(titlePanel, titlePanelConstraints);
    final GridBagConstraints monitorComponentConstraints = getMonitorConstraints(componentIndex);
    final GridBagConstraints minimizedPanelConstraints = getMinimizedPanelConstraints(monitor);
    myConstraintsLookup.put(minimizedPanel, minimizedPanelConstraints);
    if (monitor.getIsMinimized()) {
        add(minimizedPanel, minimizedPanelConstraints);
    } else {
        add(monitorComponent, monitorComponentConstraints);
    }
    myConstraintsLookup.put(monitorComponent, monitorComponentConstraints);
    myConstraintsLookup.put(titlePanel, titlePanelConstraints);
}
Also used : JBLabel(com.intellij.ui.components.JBLabel) ActionToolbarImpl(com.intellij.openapi.actionSystem.impl.ActionToolbarImpl) Border(javax.swing.border.Border)

Aggregations

ActionToolbarImpl (com.intellij.openapi.actionSystem.impl.ActionToolbarImpl)10 NotNull (org.jetbrains.annotations.NotNull)5 DefaultActionGroup (com.intellij.openapi.actionSystem.DefaultActionGroup)2 ShowMoreOptions (com.intellij.find.editorHeaderActions.ShowMoreOptions)1 CommonActionsManager (com.intellij.ide.CommonActionsManager)1 ActionGroup (com.intellij.openapi.actionSystem.ActionGroup)1 ActionManager (com.intellij.openapi.actionSystem.ActionManager)1 SwitchTaskAction (com.intellij.tasks.actions.SwitchTaskAction)1 TestActionEvent (com.intellij.testFramework.TestActionEvent)1 JBLabel (com.intellij.ui.components.JBLabel)1 JBEmptyBorder (com.intellij.util.ui.JBEmptyBorder)1 Border (javax.swing.border.Border)1 EmptyBorder (javax.swing.border.EmptyBorder)1 ComponentFinder (org.fest.swing.core.ComponentFinder)1