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;
}
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;
}
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;
}
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;
}
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);
}
Aggregations