use of com.intellij.openapi.actionSystem.impl.ActionToolbarImpl in project intellij-community by JetBrains.
the class SearchReplaceComponent method createSearchToolbar1.
@NotNull
private ActionToolbarImpl createSearchToolbar1(@NotNull DefaultActionGroup group) {
ActionToolbarImpl toolbar = createToolbar(group);
toolbar.setForceMinimumSize(true);
toolbar.setReservePlaceAutoPopupIcon(false);
toolbar.setSecondaryButtonPopupStateModifier(mySearchToolbar1PopupStateModifier);
toolbar.setSecondaryActionsTooltip("More Options(" + ShowMoreOptions.SHORT_CUT + ")");
new ShowMoreOptions(toolbar, mySearchFieldWrapper);
return toolbar;
}
use of com.intellij.openapi.actionSystem.impl.ActionToolbarImpl in project intellij-community by JetBrains.
the class RunConfigurationComboBoxFixture method find.
@NotNull
static RunConfigurationComboBoxFixture find(@NotNull final IdeFrameFixture parent) {
ComponentFinder finder = parent.robot().finder();
ActionToolbarImpl toolbar = finder.find(parent.target(), new GenericTypeMatcher<ActionToolbarImpl>(ActionToolbarImpl.class) {
@Override
protected boolean isMatching(@NotNull ActionToolbarImpl toolbar) {
String place = field("myPlace").ofType(String.class).in(toolbar).get();
return MAIN_TOOLBAR.equals(place);
}
});
JButton button = finder.find(toolbar, new GenericTypeMatcher<JButton>(JButton.class) {
@Override
protected boolean isMatching(@NotNull JButton button) {
return button.getClass().getSimpleName().equals("ComboBoxButton");
}
});
return new RunConfigurationComboBoxFixture(parent.robot(), button);
}
use of com.intellij.openapi.actionSystem.impl.ActionToolbarImpl in project intellij-community by JetBrains.
the class ContextMenuImpl method createComponent.
private JComponent createComponent() {
myActionToolbar = new ActionToolbarImpl(ActionPlaces.CONTEXT_TOOLBAR, myActionGroup, true, DataManager.getInstance(), ActionManagerEx.getInstanceEx(), KeymapManagerEx.getInstanceEx());
myActionToolbar.setTargetComponent(myEditor.getContentComponent());
myActionToolbar.setMinimumButtonSize(new Dimension(22, 22));
myActionToolbar.setReservePlaceAutoPopupIcon(false);
ContextMenuPanel contextMenuPanel = new ContextMenuPanel(this);
contextMenuPanel.setLayout(new BorderLayout(0, 0));
JComponent toolbarComponent = myActionToolbar.getComponent();
toolbarComponent.setOpaque(false);
contextMenuPanel.add(toolbarComponent);
return contextMenuPanel;
}
use of com.intellij.openapi.actionSystem.impl.ActionToolbarImpl in project intellij-community by JetBrains.
the class TaskUiTest method testTaskComboVisible.
public void testTaskComboVisible() throws Exception {
SwitchTaskAction combo = null;
ActionGroup group = (ActionGroup) CustomActionsSchema.getInstance().getCorrectedAction(IdeActions.GROUP_MAIN_TOOLBAR);
ActionToolbarImpl toolbar = (ActionToolbarImpl) ActionManager.getInstance().createActionToolbar(ActionPlaces.MAIN_TOOLBAR, group, true);
AnAction[] children = group.getChildren(new TestActionEvent());
for (AnAction child : children) {
if (child instanceof ActionGroup) {
AnAction[] actions = ((ActionGroup) child).getChildren(new TestActionEvent());
for (AnAction action : actions) {
if (action instanceof SwitchTaskAction) {
combo = (SwitchTaskAction) action;
}
}
}
}
TaskManager manager = TaskManager.getManager(getProject());
LocalTask defaultTask = manager.getActiveTask();
assertTrue(defaultTask.isDefault());
assertEquals(defaultTask.getCreated(), defaultTask.getUpdated());
Presentation presentation = doTest(combo, toolbar);
assertFalse(presentation.isVisible());
try {
TaskSettings.getInstance().ALWAYS_DISPLAY_COMBO = true;
presentation = doTest(combo, toolbar);
assertTrue(presentation.isVisible());
} finally {
TaskSettings.getInstance().ALWAYS_DISPLAY_COMBO = false;
}
LocalTask task = manager.createLocalTask("test");
manager.activateTask(task, false);
presentation = doTest(combo, toolbar);
assertTrue(presentation.isVisible());
manager.activateTask(defaultTask, false);
task = manager.getActiveTask();
assertTrue(task.isDefault());
presentation = doTest(combo, toolbar);
if (!presentation.isVisible()) {
LocalTask activeTask = manager.getActiveTask();
System.out.println(activeTask);
System.out.println(activeTask.getCreated());
System.out.println(activeTask.getUpdated());
fail();
}
}
use of com.intellij.openapi.actionSystem.impl.ActionToolbarImpl in project intellij-plugins by JetBrains.
the class SplitEditorToolbar method createToolbarFromGroupId.
@NotNull
private static ActionToolbar createToolbarFromGroupId(@NotNull String groupId) {
final ActionManager actionManager = ActionManager.getInstance();
if (!actionManager.isGroup(groupId)) {
throw new IllegalStateException(groupId + " should have been a group");
}
final ActionGroup group = ((ActionGroup) actionManager.getAction(groupId));
final ActionToolbarImpl editorToolbar = ((ActionToolbarImpl) actionManager.createActionToolbar(ActionPlaces.EDITOR_TOOLBAR, group, true));
editorToolbar.setOpaque(false);
editorToolbar.setBorder(new JBEmptyBorder(0, 2, 0, 2));
return editorToolbar;
}
Aggregations