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