Search in sources :

Example 1 with ContextHelpAction

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());
}
Also used : MatteBorder(javax.swing.border.MatteBorder) ListSelectionEvent(javax.swing.event.ListSelectionEvent) ContextHelpAction(com.intellij.ide.actions.ContextHelpAction) ListSelectionListener(javax.swing.event.ListSelectionListener)

Example 2 with ContextHelpAction

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);
}
Also used : Executor(com.intellij.execution.Executor) CloseAction(com.intellij.execution.ui.actions.CloseAction) ContextHelpAction(com.intellij.ide.actions.ContextHelpAction)

Example 3 with ContextHelpAction

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();
}
Also used : ContextHelpAction(com.intellij.ide.actions.ContextHelpAction)

Example 4 with ContextHelpAction

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;
}
Also used : ContextHelpAction(com.intellij.ide.actions.ContextHelpAction)

Example 5 with ContextHelpAction

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();
}
Also used : ContextHelpAction(com.intellij.ide.actions.ContextHelpAction)

Aggregations

ContextHelpAction (com.intellij.ide.actions.ContextHelpAction)22 CloseAction (com.intellij.execution.ui.actions.CloseAction)4 Executor (com.intellij.execution.Executor)3 NextOccurenceToolbarAction (com.intellij.ide.actions.NextOccurenceToolbarAction)2 PreviousOccurenceToolbarAction (com.intellij.ide.actions.PreviousOccurenceToolbarAction)2 NotNull (org.jetbrains.annotations.NotNull)2 DefaultDebugExecutor (com.intellij.execution.executors.DefaultDebugExecutor)1 FindModel (com.intellij.find.FindModel)1 TreeExpander (com.intellij.ide.TreeExpander)1 CloseTabToolbarAction (com.intellij.ide.actions.CloseTabToolbarAction)1 TodoItemNode (com.intellij.ide.todo.nodes.TodoItemNode)1 NodeDescriptor (com.intellij.ide.util.treeView.NodeDescriptor)1 ActionGroup (com.intellij.openapi.actionSystem.ActionGroup)1 DefaultActionGroup (com.intellij.openapi.actionSystem.DefaultActionGroup)1 ScrollToTheEndToolbarAction (com.intellij.openapi.editor.actions.ScrollToTheEndToolbarAction)1 SimpleToolWindowPanel (com.intellij.openapi.ui.SimpleToolWindowPanel)1 IgnoredSettingsAction (com.intellij.openapi.vcs.changes.actions.IgnoredSettingsAction)1 SeparatorComponent (com.intellij.ui.SeparatorComponent)1 Content (com.intellij.ui.content.Content)1 CollapseAllAction (com.intellij.ui.treeStructure.actions.CollapseAllAction)1