use of com.intellij.ide.actions.ContextHelpAction in project intellij-community by JetBrains.
the class AbstractTableView method setToolbarActions.
public final void setToolbarActions(final AnAction... actions) {
final DefaultActionGroup actionGroup = new DefaultActionGroup();
for (final AnAction action : actions) {
actionGroup.add(action);
}
if (getHelpId() != null) {
actionGroup.add(Separator.getInstance());
actionGroup.add(new ContextHelpAction(getHelpId()));
}
final ActionManager actionManager = ActionManager.getInstance();
final ToolbarPosition position = getToolbarPosition();
final ActionToolbar myActionToolbar = actionManager.createActionToolbar(ActionPlaces.PROJECT_VIEW_TOOLBAR, actionGroup, position == ToolbarPosition.TOP || position == ToolbarPosition.BOTTOM);
myActionToolbar.setTargetComponent(myInnerPanel);
final JComponent toolbarComponent = myActionToolbar.getComponent();
final MatteBorder matteBorder = BorderFactory.createMatteBorder(0, 0, position == ToolbarPosition.TOP ? 1 : 0, 0, JBColor.DARK_GRAY);
toolbarComponent.setBorder(BorderFactory.createCompoundBorder(matteBorder, toolbarComponent.getBorder()));
getTable().getSelectionModel().addListSelectionListener(new ListSelectionListener() {
@Override
public void valueChanged(ListSelectionEvent e) {
myActionToolbar.updateActionsImmediately();
}
});
add(toolbarComponent, position.getPosition());
}
use of com.intellij.ide.actions.ContextHelpAction in project intellij-community by JetBrains.
the class PyEduDebugRunner method patchLeftToolbar.
private static void patchLeftToolbar(@NotNull XDebugSession session, @NotNull RunnerLayoutUi ui) {
DefaultActionGroup newLeftToolbar = new DefaultActionGroup();
DefaultActionGroup firstGroup = new DefaultActionGroup();
addActionToGroup(firstGroup, XDebuggerActions.RESUME);
addActionToGroup(firstGroup, IdeActions.ACTION_STOP_PROGRAM);
newLeftToolbar.addAll(firstGroup);
newLeftToolbar.addSeparator();
Executor executor = PyEduDebugExecutor.getInstance();
newLeftToolbar.add(new CloseAction(executor, session.getRunContentDescriptor(), session.getProject()));
//TODO: return proper helpID
newLeftToolbar.add(new ContextHelpAction(executor.getHelpId()));
ui.getOptions().setLeftToolbar(newLeftToolbar, ActionPlaces.DEBUGGER_TOOLBAR);
}
use of com.intellij.ide.actions.ContextHelpAction in project intellij-community by JetBrains.
the class DependenciesPanel method createToolbar.
private JComponent createToolbar() {
DefaultActionGroup group = new DefaultActionGroup();
group.add(new CloseAction());
group.add(new RerunAction(this));
group.add(new FlattenPackagesAction());
group.add(new ShowFilesAction());
if (ModuleManager.getInstance(myProject).getModules().length > 1) {
group.add(new ShowModulesAction());
group.add(new ShowModuleGroupsAction());
}
group.add(new GroupByScopeTypeAction());
//group.add(new GroupByFilesAction());
group.add(new FilterLegalsAction());
group.add(new MarkAsIllegalAction());
group.add(new ChooseScopeTypeAction());
group.add(new EditDependencyRulesAction());
group.add(CommonActionsManager.getInstance().createExportToTextFileAction(new DependenciesExporterToTextFile()));
group.add(new ContextHelpAction("dependency.viewer.tool.window"));
ActionToolbar toolbar = ActionManager.getInstance().createActionToolbar(ActionPlaces.UNKNOWN, group, true);
return toolbar.getComponent();
}
use of com.intellij.ide.actions.ContextHelpAction in project intellij-community by JetBrains.
the class ModulesDependenciesPanel method createNorthPanel.
private JComponent createNorthPanel() {
DefaultActionGroup group = new DefaultActionGroup();
group.add(new AnAction(CommonBundle.message("action.close"), null, AllIcons.Actions.Cancel) {
@Override
public void actionPerformed(AnActionEvent e) {
DependenciesAnalyzeManager.getInstance(myProject).closeContent(myContent);
}
});
final AnAction analyzeDepsAction = ActionManager.getInstance().getAction(IdeActions.ACTION_ANALYZE_DEPENDENCIES);
group.add(new AnAction(analyzeDepsAction.getTemplatePresentation().getText(), null, AllIcons.Toolwindows.ToolWindowInspection) {
@Override
public void actionPerformed(AnActionEvent e) {
analyzeDepsAction.actionPerformed(e);
}
@Override
public void update(AnActionEvent e) {
analyzeDepsAction.update(e);
}
});
group.add(new ToggleAction(AnalysisScopeBundle.message("action.module.dependencies.direction")) {
@Override
public boolean isSelected(AnActionEvent e) {
return !myState.forwardDirection;
}
@Override
public void setSelected(AnActionEvent e, boolean state) {
myState.forwardDirection = !state;
updateLeftTree();
}
@Override
public void update(@NotNull AnActionEvent e) {
e.getPresentation().setIcon(myState.forwardDirection ? AllIcons.Hierarchy.Subtypes : AllIcons.Hierarchy.Supertypes);
super.update(e);
}
});
group.add(new ToggleAction(AnalysisScopeBundle.message("action.module.dependencies.tests"), null, AllIcons.Modules.TestSourceFolder) {
@Override
public boolean isSelected(AnActionEvent e) {
return myState.includeTests;
}
@Override
public void setSelected(AnActionEvent e, boolean state) {
myState.includeTests = state;
updateModuleGraph();
updateLeftTree();
}
});
group.add(new ContextHelpAction(HELP_ID));
ActionToolbar toolbar = ActionManager.getInstance().createActionToolbar(ActionPlaces.UNKNOWN, group, true);
JPanel panel = new JPanel(new BorderLayout());
panel.add(toolbar.getComponent(), BorderLayout.WEST);
panel.add(myPathField, BorderLayout.CENTER);
return panel;
}
use of com.intellij.ide.actions.ContextHelpAction in project intellij-community by JetBrains.
the class CyclicDependenciesPanel method createToolbar.
private JComponent createToolbar() {
DefaultActionGroup group = new DefaultActionGroup();
group.add(new CloseAction());
group.add(new RerunAction(this));
group.add(new ShowFilesAction());
group.add(new HideOutOfCyclePackagesAction());
group.add(new GroupByScopeTypeAction());
group.add(new ContextHelpAction("dependency.viewer.tool.window"));
ActionToolbar toolbar = ActionManager.getInstance().createActionToolbar(ActionPlaces.UNKNOWN, group, true);
return toolbar.getComponent();
}
Aggregations