Search in sources :

Example 11 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 12 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)

Example 13 with ContextHelpAction

use of com.intellij.ide.actions.ContextHelpAction in project intellij-plugins by JetBrains.

the class IDEtalkToolWindow method createToolWindowComponent.

@Override
protected void createToolWindowComponent() {
    StartupManager.getInstance(myProject).registerPostStartupActivity(() -> initializeTransports(myProject.getName()));
    StatusToolbar statusToolbar = ((StatusToolbar) myContainer.getComponentInstanceOfType(StatusToolbar.class));
    DefaultActionGroup toolbarActions = new DefaultActionGroup();
    ActionGroup actions = (ActionGroup) myActionManager.getAction("IDEtalk");
    if (actions != null) {
        toolbarActions.addAll(actions);
    }
    toolbarActions.add(new ContextHelpAction("reference.toolWindows.idetalk"));
    ActionGroup treeActions = (ActionGroup) myActionManager.getAction("IDEtalk_Tree");
    JPanel toolbarPanel = new JPanel();
    toolbarPanel.setLayout(new BoxLayout(toolbarPanel, BoxLayout.X_AXIS));
    toolbarPanel.add(DropDownButton.wrap(new DropDownButton(new FindUsersAction(), IconUtil.getAddIcon())));
    toolbarPanel.add(createToolbar(toolbarActions).getComponent());
    toolbarPanel.add(Box.createHorizontalStrut(10));
    toolbarPanel.add(new SeparatorComponent(JBColor.LIGHT_GRAY, SeparatorOrientation.VERTICAL));
    toolbarPanel.add(Box.createHorizontalStrut(3));
    toolbarPanel.add(DropDownButton.wrap(new OptionsButton()));
    toolbarPanel.add(statusToolbar.createComponent());
    toolbarPanel.add(new JPanel() {

        @Override
        public Dimension getPreferredSize() {
            return new Dimension(Short.MAX_VALUE, 10);
        }
    });
    if (treeActions != null) {
        JComponent component = createToolbar(treeActions).getComponent();
        component.setMinimumSize(component.getPreferredSize());
        toolbarPanel.add(component);
    }
    toolbarPanel.setAlignmentX(0);
    myTopPanel.add(toolbarPanel);
    myPanel.add(myTopPanel, BorderLayout.NORTH);
    myPanel.add(ScrollPaneFactory.createScrollPane(myUserListComponent.getComponent()));
    ActionGroup group = (ActionGroup) myActionManager.getAction("IDEtalkPopup");
    if (group != null) {
        IDEAFacade.installPopupMenu(group, myUserListComponent.getTree(), myActionManager);
    }
}
Also used : DropDownButton(jetbrains.communicator.idea.actions.DropDownButton) DefaultActionGroup(com.intellij.openapi.actionSystem.DefaultActionGroup) ContextHelpAction(com.intellij.ide.actions.ContextHelpAction) StatusToolbar(jetbrains.communicator.ide.StatusToolbar) SeparatorComponent(com.intellij.ui.SeparatorComponent) ActionGroup(com.intellij.openapi.actionSystem.ActionGroup) DefaultActionGroup(com.intellij.openapi.actionSystem.DefaultActionGroup) OptionsButton(jetbrains.communicator.idea.actions.OptionsButton) FindUsersAction(jetbrains.communicator.idea.actions.FindUsersAction)

Example 14 with ContextHelpAction

use of com.intellij.ide.actions.ContextHelpAction in project intellij-community by JetBrains.

the class ChangesViewManager method createChangeViewComponent.

private JComponent createChangeViewComponent() {
    SimpleToolWindowPanel panel = new SimpleToolWindowPanel(false, true);
    EmptyAction.registerWithShortcutSet("ChangesView.Refresh", CommonShortcuts.getRerun(), panel);
    EmptyAction.registerWithShortcutSet("ChangesView.NewChangeList", CommonShortcuts.getNew(), panel);
    EmptyAction.registerWithShortcutSet("ChangesView.RemoveChangeList", CommonShortcuts.getDelete(), panel);
    EmptyAction.registerWithShortcutSet(IdeActions.MOVE_TO_ANOTHER_CHANGE_LIST, CommonShortcuts.getMove(), panel);
    EmptyAction.registerWithShortcutSet("ChangesView.Rename", CommonShortcuts.getRename(), panel);
    EmptyAction.registerWithShortcutSet("ChangesView.SetDefault", new CustomShortcutSet(KeyStroke.getKeyStroke(KeyEvent.VK_U, InputEvent.ALT_DOWN_MASK | ctrlMask())), panel);
    EmptyAction.registerWithShortcutSet("ChangesView.Diff", CommonShortcuts.getDiff(), panel);
    DefaultActionGroup group = (DefaultActionGroup) ActionManager.getInstance().getAction("ChangesViewToolbar");
    ActionToolbar toolbar = ActionManager.getInstance().createActionToolbar(ActionPlaces.CHANGES_VIEW_TOOLBAR, group, false);
    toolbar.setTargetComponent(myView);
    JComponent toolbarComponent = toolbar.getComponent();
    JPanel toolbarPanel = new JPanel(new BorderLayout());
    toolbarPanel.add(toolbarComponent, BorderLayout.WEST);
    DefaultActionGroup visualActionsGroup = new DefaultActionGroup();
    final Expander expander = new Expander();
    visualActionsGroup.add(CommonActionsManager.getInstance().createExpandAllAction(expander, panel));
    visualActionsGroup.add(CommonActionsManager.getInstance().createCollapseAllAction(expander, panel));
    ToggleShowFlattenAction showFlattenAction = new ToggleShowFlattenAction();
    showFlattenAction.registerCustomShortcutSet(new CustomShortcutSet(KeyStroke.getKeyStroke(KeyEvent.VK_P, ctrlMask())), panel);
    visualActionsGroup.add(showFlattenAction);
    visualActionsGroup.add(ActionManager.getInstance().getAction(IdeActions.ACTION_COPY));
    visualActionsGroup.add(new ToggleShowIgnoredAction());
    visualActionsGroup.add(new IgnoredSettingsAction());
    visualActionsGroup.add(new ToggleDetailsAction());
    visualActionsGroup.add(new ContextHelpAction(ChangesListView.HELP_ID));
    toolbarPanel.add(ActionManager.getInstance().createActionToolbar(ActionPlaces.CHANGES_VIEW_TOOLBAR, visualActionsGroup, false).getComponent(), BorderLayout.CENTER);
    myView.setMenuActions((DefaultActionGroup) ActionManager.getInstance().getAction("ChangesViewPopupMenu"));
    myView.setShowFlatten(myState.myShowFlatten);
    myProgressLabel = new JPanel(new BorderLayout());
    panel.setToolbar(toolbarPanel);
    final JPanel content = new JPanel(new BorderLayout());
    mySplitter = new JBSplitter(false, "ChangesViewManager.DETAILS_SPLITTER_PROPORTION", 0.5f);
    mySplitter.setHonorComponentsMinimumSize(false);
    final JScrollPane scrollPane = ScrollPaneFactory.createScrollPane(myView);
    final JPanel wrapper = new JPanel(new BorderLayout());
    wrapper.add(scrollPane, BorderLayout.CENTER);
    mySplitter.setFirstComponent(wrapper);
    content.add(mySplitter, BorderLayout.CENTER);
    content.add(myProgressLabel, BorderLayout.SOUTH);
    panel.setContent(content);
    ChangesDnDSupport.install(myProject, myView);
    myView.addTreeSelectionListener(myTsl);
    return panel;
}
Also used : TreeExpander(com.intellij.ide.TreeExpander) SimpleToolWindowPanel(com.intellij.openapi.ui.SimpleToolWindowPanel) ContextHelpAction(com.intellij.ide.actions.ContextHelpAction) IgnoredSettingsAction(com.intellij.openapi.vcs.changes.actions.IgnoredSettingsAction)

Example 15 with ContextHelpAction

use of com.intellij.ide.actions.ContextHelpAction in project intellij-community by JetBrains.

the class HistoryDialog method createRevisionsActions.

private ActionGroup createRevisionsActions() {
    DefaultActionGroup result = new DefaultActionGroup();
    result.add(new RevertAction());
    result.add(new CreatePatchAction());
    result.add(Separator.getInstance());
    result.add(new ContextHelpAction(getHelpId()));
    return result;
}
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