void installKeyAction(JComponent component) { new AnAction() { @Override public void actionPerformed(AnActionEvent e) { InputEvent event = e.getInputEvent(); if (event instanceof KeyEvent) { int row = myList.getSelectedIndex(); int toSelect; switch (((KeyEvent)event).getKeyCode()) { case KeyEvent.VK_UP: toSelect = row == 0 ? myList.getItemsCount() - 1 : row - 1; myList.setSelectedIndex(toSelect); myList.ensureIndexIsVisible(toSelect); break; case KeyEvent.VK_DOWN: toSelect = row < myList.getItemsCount() - 1 ? row + 1 : 0; myList.setSelectedIndex(toSelect); myList.ensureIndexIsVisible(toSelect); break; } } } }.registerCustomShortcutSet(new CustomShortcutSet(KeyEvent.VK_UP, KeyEvent.VK_DOWN), component); }
public TipManager(final JComponent component, TipFactory factory) { myTipFactory = factory; myComponent = component; new UiNotifyConnector.Once(component, new Activatable() { public void showNotify() { installListeners(); } public void hideNotify() { } }); final HideTooltipAction hide = new HideTooltipAction(); hide.registerCustomShortcutSet(new CustomShortcutSet(KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0)), myComponent); Disposer.register(this, new Disposable() { public void dispose() { hide.unregisterCustomShortcutSet(myComponent); } }); }
protected JComponent createCenterPanel() { myTextArea = new JTextArea(10, 50); myTextArea.setText(getText()); myTextArea.setWrapStyleWord(true); myTextArea.setLineWrap(true); myTextArea.getDocument().addDocumentListener(new DocumentAdapter() { public void textChanged(DocumentEvent event) { if (myChangeListener != null) { myChangeListener.run(); } } }); new AnAction() { public void actionPerformed(AnActionEvent e) { doOKAction(); } }.registerCustomShortcutSet(new CustomShortcutSet(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0)), myTextArea); return ScrollPaneFactory.createScrollPane(myTextArea); }
public CloseOnESCAction(EditorSearchComponent editorSearchComponent, JComponent textField) { super(editorSearchComponent); ArrayList<Shortcut> shortcuts = new ArrayList<Shortcut>(); if (KeymapUtil.isEmacsKeymap()) { shortcuts.add(new KeyboardShortcut(KeyStroke.getKeyStroke(KeyEvent.VK_G, InputEvent.CTRL_MASK), null)); textField.registerKeyboardAction(new ActionListener() { @Override public void actionPerformed(final ActionEvent e) { CloseOnESCAction.this.actionPerformed(null); } }, KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0), JComponent.WHEN_FOCUSED); } else { shortcuts.add(new KeyboardShortcut(KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0), null)); } registerCustomShortcutSet(new CustomShortcutSet(shortcuts.toArray(new Shortcut[shortcuts.size()])), textField); }
public PaletteWindow(Project project) { myProject = project; myProviders = Extensions.getExtensions(PaletteItemProvider.EP_NAME, project); setLayout(new GridLayout(1, 1)); myScrollPane.addMouseListener(new MyScrollPanePopupHandler()); myScrollPane.setBorder(null); KeyStroke escStroke = KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0); new ClearActiveItemAction().registerCustomShortcutSet(new CustomShortcutSet(escStroke), myScrollPane); if(!ApplicationManager.getApplication().isHeadlessEnvironment()) { DragSource.getDefaultDragSource().addDragSourceListener(myDragSourceListener); } }
@Override protected JComponent createCenterPanel() { myTextArea = new JTextArea(10, 50); myTextArea.setText(getText()); myTextArea.setWrapStyleWord(true); myTextArea.setLineWrap(true); myTextArea.getDocument().addDocumentListener(new DocumentAdapter() { @Override public void textChanged(DocumentEvent event) { if (myChangeListener != null) { myChangeListener.run(); } } }); new AnAction() { @Override public void actionPerformed(AnActionEvent e) { doOKAction(); } }.registerCustomShortcutSet(new CustomShortcutSet(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0)), myTextArea); return ScrollPaneFactory.createScrollPane(myTextArea); }
@Override protected void subInit() { super.subInit(); this.myMessageTextField = new EditorTextField(""); this.myKindUpDownHint = new JLabel(); this.myKindUpDownHint.setIcon(PlatformIcons.UP_DOWN_ARROWS); this.myKindUpDownHint.setToolTipText(PhpBundle.message("actions.new.php.base.arrows.kind.tooltip")); this.myKindComboBox = new ComboBox<String>(); this.myKindComboBox.setMinimumAndPreferredWidth(400); this.myKindComboBox.setRenderer(new ListCellRendererWrapper<Trinity>() { public void customize(JList list, Trinity value, int index, boolean selected, boolean hasFocus) { this.setText((String)value.first); this.setIcon((Icon)value.second); } }); ComboboxSpeedSearch var10001 = new ComboboxSpeedSearch(this.myKindComboBox) { protected String getElementText(Object element) { return (String)((Trinity)element).first; } }; KeyboardShortcut up = new KeyboardShortcut(KeyStroke.getKeyStroke(38, 0), (KeyStroke)null); KeyboardShortcut down = new KeyboardShortcut(KeyStroke.getKeyStroke(40, 0), (KeyStroke)null); AnAction kindArrow = PhpNewFileDialog.getCbArrowAction(this.myKindComboBox); kindArrow.registerCustomShortcutSet(new CustomShortcutSet(new Shortcut[]{up, down}), this.myNameTextField); List<Trinity> exceptionTypes = this.getExceptionTypes(); for(Trinity type : exceptionTypes) { this.myKindComboBox.addItem(type); } }
public static InspectDebuggerTree createInspectTree(final NodeDescriptorImpl descriptor, Project project) { final InspectDebuggerTree tree = new InspectDebuggerTree(project); final AnAction setValueAction = ActionManager.getInstance().getAction(DebuggerActions.SET_VALUE); setValueAction.registerCustomShortcutSet(new CustomShortcutSet(KeyStroke.getKeyStroke(KeyEvent.VK_F2, 0)), tree); Disposer.register(tree, new Disposable() { @Override public void dispose() { setValueAction.unregisterCustomShortcutSet(tree); } }); tree.setInspectDescriptor(descriptor); DebuggerContextImpl context = DebuggerManagerEx.getInstanceEx(project).getContext(); tree.rebuild(context); return tree; }
@Override @NotNull public AnAction[] createFilteringActions(@NotNull final UsageView view) { final UsageViewImpl impl = (UsageViewImpl)view; if (view.getPresentation().isCodeUsages()) { final JComponent component = view.getComponent(); final ShowImportsAction showImportsAction = new ShowImportsAction(impl); showImportsAction.registerCustomShortcutSet(new CustomShortcutSet(KeyStroke.getKeyStroke(KeyEvent.VK_I, InputEvent.CTRL_DOWN_MASK)), component, view); return new AnAction[] { showImportsAction }; } else { return AnAction.EMPTY_ARRAY; } }
@Override @NotNull public AnAction[] createGroupingActions(UsageView view) { UsageViewImpl impl = (UsageViewImpl)view; JComponent component = impl.getComponent(); GroupByModuleTypeAction groupByModuleTypeAction = supportsModuleRule() ? new GroupByModuleTypeAction(impl) : null; if (groupByModuleTypeAction != null) { groupByModuleTypeAction.registerCustomShortcutSet(new CustomShortcutSet(KeyStroke.getKeyStroke(KeyEvent.VK_D, InputEvent.CTRL_DOWN_MASK)), component, impl); } GroupByFileStructureAction groupByFileStructureAction = createGroupByFileStructureAction(impl); GroupByScopeAction groupByScopeAction = supportsScopesRule() ? new GroupByScopeAction(impl) : null; GroupByPackageAction groupByPackageAction = new GroupByPackageAction(impl); groupByPackageAction.registerCustomShortcutSet(new CustomShortcutSet(KeyStroke.getKeyStroke(KeyEvent.VK_P, InputEvent.CTRL_DOWN_MASK)), component, impl); ArrayList<AnAction> result = ContainerUtil.newArrayList(); if (view.getPresentation().isUsageTypeFilteringAvailable()) { GroupByUsageTypeAction groupByUsageTypeAction = new GroupByUsageTypeAction(impl); groupByUsageTypeAction.registerCustomShortcutSet(new CustomShortcutSet(KeyStroke.getKeyStroke(KeyEvent.VK_T, InputEvent.CTRL_DOWN_MASK)), component, impl); ContainerUtil.addIfNotNull(result, groupByUsageTypeAction); ContainerUtil.addIfNotNull(result, groupByScopeAction); ContainerUtil.addIfNotNull(result, groupByModuleTypeAction); ContainerUtil.addIfNotNull(result, groupByPackageAction); ContainerUtil.addIfNotNull(result, groupByFileStructureAction); } else { ContainerUtil.addIfNotNull(result, groupByScopeAction); ContainerUtil.addIfNotNull(result, groupByModuleTypeAction); ContainerUtil.addIfNotNull(result, groupByPackageAction); ContainerUtil.addIfNotNull(result, groupByFileStructureAction); } return result.toArray(new AnAction[result.size()]); }
public static GroupByFileStructureAction createGroupByFileStructureAction(UsageViewImpl impl) { final JComponent component = impl.getComponent(); final GroupByFileStructureAction groupByFileStructureAction = new GroupByFileStructureAction(impl); groupByFileStructureAction.registerCustomShortcutSet(new CustomShortcutSet(KeyStroke.getKeyStroke(KeyEvent.VK_M, InputEvent.CTRL_DOWN_MASK)), component, impl); return groupByFileStructureAction; }
/** * Creates shortcut for mnemonic replacing standard Alt+Letter to Ctrl+Alt+Letter on Mac with jdk version newer than 6 * @param ch mnemonic letter * @return shortcut for mnemonic */ public static CustomShortcutSet createShortcut(char ch) { Character mnemonic = Character.valueOf(ch); String shortcut = SystemInfo.isMac && SystemInfo.isJavaVersionAtLeast("1.7") ? "control alt pressed " + mnemonic : "alt pressed " + mnemonic; return CustomShortcutSet.fromString(shortcut); }
protected QuickFixAction(String text, Icon icon, KeyStroke keyStroke, @NotNull InspectionToolWrapper toolWrapper) { super(text, null, icon); myToolWrapper = toolWrapper; if (keyStroke != null) { registerCustomShortcutSet(new CustomShortcutSet(keyStroke), null); } }
protected void createEditingActions() { for (final ModuleSourceRootEditHandler<?> editor : myEditHandlers) { ToggleSourcesStateAction action = new ToggleSourcesStateAction(myTree, this, editor); CustomShortcutSet shortcutSet = editor.getMarkRootShortcutSet(); if (shortcutSet != null) { action.registerCustomShortcutSet(shortcutSet, myTree); } myEditingActionsGroup.add(action); } setupExcludedAction(); }
public ShowHistoryAction(boolean search) { super((search ? "Search" : "Replace") + " History", (search ? "Search" : "Replace") + " history", IconLoader.findIcon("/com/intellij/ide/ui/laf/icons/search.png", DarculaTextFieldUI.class, true)); myShowSearchHistory = search; KeyStroke stroke = KeyStroke.getKeyStroke(KeyEvent.VK_H, InputEvent.CTRL_DOWN_MASK); registerCustomShortcutSet(new CustomShortcutSet(new KeyboardShortcut(stroke, null)), myTextArea); }
EditBookmarkDescriptionAction(Project project, JList list) { super(IdeBundle.message("action.bookmark.edit.description"), IdeBundle.message("action.bookmark.edit.description.description"), AllIcons.Actions.Edit); myProject = project; myList = list; registerCustomShortcutSet(new CustomShortcutSet(KeyStroke.getKeyStroke(SystemInfo.isMac ? "meta ENTER" : "control ENTER")), list); }
public void registerUpDownHint(JComponent component) { new DumbAwareAction() { @Override public void actionPerformed(AnActionEvent e) { if (e.getInputEvent() instanceof KeyEvent) { final int code = ((KeyEvent)e.getInputEvent()).getKeyCode(); scrollBy(code == KeyEvent.VK_DOWN ? 1 : code == KeyEvent.VK_UP ? -1 : 0); } } }.registerCustomShortcutSet(new CustomShortcutSet(KeyEvent.VK_UP, KeyEvent.VK_DOWN), component); }
@Override protected void createEditingActions() { super.createEditingActions(); for (PyRootTypeProvider provider : myRootTypeProviders) { ContentEntryEditingAction action = provider.createRootEntryEditingAction(myTree, myFilePointersDisposable, PyContentEntriesEditor.this, getModel()); myEditingActionsGroup.add(action); CustomShortcutSet shortcut = provider.getShortcut(); if (shortcut != null) { action.registerCustomShortcutSet(shortcut, myTree); } } }
private void registerHeadingActions() { new IpnbHeading1CellAction().registerCustomShortcutSet(new CustomShortcutSet(KeyStroke.getKeyStroke("ctrl shift 1")), myIpnbFilePanel); new IpnbHeading2CellAction().registerCustomShortcutSet(new CustomShortcutSet(KeyStroke.getKeyStroke("ctrl shift 2")), myIpnbFilePanel); new IpnbHeading3CellAction().registerCustomShortcutSet(new CustomShortcutSet(KeyStroke.getKeyStroke("ctrl shift 3")), myIpnbFilePanel); new IpnbHeading4CellAction().registerCustomShortcutSet(new CustomShortcutSet(KeyStroke.getKeyStroke("ctrl shift 4")), myIpnbFilePanel); new IpnbHeading5CellAction().registerCustomShortcutSet(new CustomShortcutSet(KeyStroke.getKeyStroke("ctrl shift 5")), myIpnbFilePanel); new IpnbHeading6CellAction().registerCustomShortcutSet(new CustomShortcutSet(KeyStroke.getKeyStroke("ctrl shift 6")), myIpnbFilePanel); }
@Override protected void addActionsTo(DefaultActionGroup group) { super.addActionsTo(group); ShowAllAffectedGenericAction showCommit = ShowAllAffectedGenericAction.getInstance(); showCommit.registerCustomShortcutSet(new CustomShortcutSet( CommonShortcuts.DOUBLE_CLICK_1.getShortcuts()[0]), myTree); group.addAction(showCommit); }
public static void registerUpDownHint(JComponent component, final GrTypeComboBox combo) { final AnAction arrow = new AnAction() { @Override public void actionPerformed(AnActionEvent e) { if (e.getInputEvent() instanceof KeyEvent) { final int code = ((KeyEvent)e.getInputEvent()).getKeyCode(); scrollBy(code == KeyEvent.VK_DOWN ? 1 : code == KeyEvent.VK_UP ? -1 : 0, combo); } } }; final KeyboardShortcut up = new KeyboardShortcut(KeyStroke.getKeyStroke(KeyEvent.VK_UP, InputEvent.ALT_DOWN_MASK), null); final KeyboardShortcut down = new KeyboardShortcut(KeyStroke.getKeyStroke(KeyEvent.VK_DOWN, InputEvent.ALT_DOWN_MASK), null); arrow.registerCustomShortcutSet(new CustomShortcutSet(up, down), component); }
@Override @NotNull public AnAction[] createGroupingActions(UsageView view) { final UsageViewImpl impl = (UsageViewImpl)view; final JComponent component = impl.getComponent(); final GroupByModuleTypeAction groupByModuleTypeAction = new GroupByModuleTypeAction(impl); groupByModuleTypeAction.registerCustomShortcutSet(new CustomShortcutSet(KeyStroke.getKeyStroke(KeyEvent.VK_D, InputEvent.CTRL_DOWN_MASK)), component, impl); final GroupByFileStructureAction groupByFileStructureAction = createGroupByFileStructureAction(impl); final GroupByScopeAction groupByScopeAction = new GroupByScopeAction(impl); final GroupByPackageAction groupByPackageAction = new GroupByPackageAction(impl); groupByPackageAction.registerCustomShortcutSet(new CustomShortcutSet(KeyStroke.getKeyStroke(KeyEvent.VK_P, InputEvent.CTRL_DOWN_MASK)), component, impl); if(view.getPresentation().isCodeUsages()) { final GroupByUsageTypeAction groupByUsageTypeAction = new GroupByUsageTypeAction(impl); groupByUsageTypeAction.registerCustomShortcutSet(new CustomShortcutSet(KeyStroke.getKeyStroke(KeyEvent.VK_T, InputEvent.CTRL_DOWN_MASK)), component, impl); return new AnAction[] { groupByUsageTypeAction, groupByScopeAction, groupByModuleTypeAction, groupByPackageAction, groupByFileStructureAction, }; } else { return new AnAction[] { groupByScopeAction, groupByModuleTypeAction, groupByPackageAction, groupByFileStructureAction, }; } }
protected void createEditingActions() { if (myCanMarkSources) { ToggleSourcesStateAction markSourcesAction = new ToggleSourcesStateAction(myTree, this, false); markSourcesAction.registerCustomShortcutSet(new CustomShortcutSet(KeyStroke.getKeyStroke(KeyEvent.VK_S, InputEvent.ALT_MASK)), myTree); myEditingActionsGroup.add(markSourcesAction); } if (myCanMarkTestSources) { setupTestsAction(); } setupExcludedAction(); }
public ReplaceOnEnterAction(EditorSearchComponent editorSearchComponent, JComponent textField) { super(editorSearchComponent); ArrayList<Shortcut> shortcuts = new ArrayList<Shortcut>(); shortcuts.add(new KeyboardShortcut(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0), null)); registerCustomShortcutSet(new CustomShortcutSet(shortcuts.toArray(new Shortcut[shortcuts.size()])), textField); }
public void registerUpDownHint(JComponent component) { new AnAction() { @Override public void actionPerformed(AnActionEvent e) { if (e.getInputEvent() instanceof KeyEvent) { final int code = ((KeyEvent)e.getInputEvent()).getKeyCode(); scrollBy(code == KeyEvent.VK_DOWN ? 1 : code == KeyEvent.VK_UP ? -1 : 0); } } }.registerCustomShortcutSet(new CustomShortcutSet(KeyEvent.VK_UP, KeyEvent.VK_DOWN), component); }
void install(JComponent component) { for( Object item : popup.getListStep().getValues() ) { if ( item instanceof PopupFactoryImpl.ActionItem ) { if ( ((PopupFactoryImpl.ActionItem)item).getAction() instanceof GuardPopupAction ) { ((GuardPopupAction)((PopupFactoryImpl.ActionItem)item).getAction()) .extendKeyboardActions(new Extender((PopupFactoryImpl.ActionItem)item)); } } } for( Map.Entry<KeyStroke, Mapping> mapping : mappings.entrySet() ) { mapping.getValue().registerCustomShortcutSet(new CustomShortcutSet(mapping.getKey()), component); } }
@Override public void perform(@NotNull final AnActionEvent e) { PsiDocumentManager documentManager = PsiDocumentManager.getInstance(target.getElement().getProject()); Document document = documentManager.getDocument(target.getElement().getContainingFile()); if ( document == null ) { Diagnostics.notifyError(e, "Document is null"); return; } if ( target.getElement().getModifierList() == null ) { Diagnostics.notifyError(e, "Modifier of list is null (Element: %s)", getView()); return; } if ( getView().getElement().getQualifiedName() == null ) { Diagnostics.notifyError(e, "Anonymous guard type"); return; } final PsiAnnotation psiAnnotation = target.getElement().getModifierList().addAnnotation(getView().getElement().getQualifiedName()); JavaCodeStyleManager.getInstance(target.getElement().getProject()).shortenClassReferences(psiAnnotation); documentManager.doPostponedOperationsAndUnblockDocument(document); if ( getView().getAttributeMethods().iterator().hasNext() ) { new EditGuardAction(AddGuardAction.this, target.getGuards().firstMatch(new Predicate<PsiGuard>() { @Override public boolean apply(PsiGuard psiGuard) { return psiGuard.getElement().equals(psiAnnotation); } }).get()).actionPerformed(e); } //PsiDocumentManager.getInstance(getElement().getProject()).commitDocument(); //new EditGuardAction() setShortcutSet(new CustomShortcutSet(KeyStroke.getKeyStroke(KeyEvent.VK_INSERT, 0))); //getController().shopPopup(e.getDataContext(), SelectionKey.of(psiAnnotation, SelectionKey.Option.PULL_UP)); }
public static void installUndoRedoSupport(JTextComponent textComponent) { final UndoManager undoManager = new UndoManager(); Keymap keymap = KeymapManager.getInstance().getActiveKeymap(); new UndoAction(undoManager).registerCustomShortcutSet(new CustomShortcutSet(keymap.getShortcuts("$Undo")), textComponent); new RedoAction(undoManager).registerCustomShortcutSet(new CustomShortcutSet(keymap.getShortcuts("$Redo")), textComponent); textComponent.getDocument().addUndoableEditListener(new UndoableEditListener() { public void undoableEditHappened(UndoableEditEvent event) { undoManager.addEdit(event.getEdit()); } }); }
protected JComponent createActionsToolbar(final Editor editor, final int lineNumber) { final JComponent editorComponent = editor.getComponent(); final DefaultActionGroup group = new DefaultActionGroup(); final GotoPreviousCoveredLineAction prevAction = new GotoPreviousCoveredLineAction(editor, lineNumber); final GotoNextCoveredLineAction nextAction = new GotoNextCoveredLineAction(editor, lineNumber); group.add(prevAction); group.add(nextAction); prevAction.registerCustomShortcutSet(new CustomShortcutSet(KeyStroke.getKeyStroke(KeyEvent.VK_UP, InputEvent.ALT_MASK|InputEvent.SHIFT_MASK)), editorComponent); nextAction.registerCustomShortcutSet(new CustomShortcutSet(KeyStroke.getKeyStroke(KeyEvent.VK_DOWN, InputEvent.ALT_MASK|InputEvent.SHIFT_MASK)), editorComponent); final LineData lineData = getLineData(lineNumber); if (myCoverageByTestApplicable) { group.add(new ShowCoveringTestsAction(myClassName, lineData)); } final AnAction byteCodeViewAction = ActionManager.getInstance().getAction("ByteCodeViewer"); if (byteCodeViewAction != null) { group.add(byteCodeViewAction); } group.add(new EditCoverageColorsAction(editor, lineNumber)); group.add(new HideCoverageInfoAction()); final ActionToolbar toolbar = ActionManager.getInstance().createActionToolbar(ActionPlaces.FILEHISTORY_VIEW_TOOLBAR, group, true); final JComponent toolbarComponent = toolbar.getComponent(); final Color background = ((EditorEx)editor).getBackgroundColor(); final Color foreground = editor.getColorsScheme().getColor(EditorColors.CARET_COLOR); toolbarComponent.setBackground(background); toolbarComponent.setBorder(new ColoredSideBorder(foreground, foreground, lineData == null || lineData.getStatus() == LineCoverage.NONE || mySubCoverageActive ? foreground : null, foreground, 1)); toolbar.updateActionsImmediately(); return toolbarComponent; }
@Override @Nonnull public AnAction[] createFilteringActions(@Nonnull final UsageView view) { final UsageViewImpl impl = (UsageViewImpl)view; if (view.getPresentation().isCodeUsages()) { final JComponent component = view.getComponent(); final ShowImportsAction showImportsAction = new ShowImportsAction(impl); showImportsAction.registerCustomShortcutSet(new CustomShortcutSet(KeyStroke.getKeyStroke(KeyEvent.VK_I, InputEvent.CTRL_DOWN_MASK)), component, view); return new AnAction[] { showImportsAction }; } else { return AnAction.EMPTY_ARRAY; } }
@Override @Nonnull public AnAction[] createGroupingActions(UsageView view) { final UsageViewImpl impl = (UsageViewImpl)view; final JComponent component = impl.getComponent(); final GroupByModuleTypeAction groupByModuleTypeAction = new GroupByModuleTypeAction(impl); groupByModuleTypeAction.registerCustomShortcutSet(new CustomShortcutSet(KeyStroke.getKeyStroke(KeyEvent.VK_D, InputEvent.CTRL_DOWN_MASK)), component, impl); final GroupByFileStructureAction groupByFileStructureAction = createGroupByFileStructureAction(impl); final GroupByScopeAction groupByScopeAction = new GroupByScopeAction(impl); final GroupByPackageAction groupByPackageAction = new GroupByPackageAction(impl); groupByPackageAction.registerCustomShortcutSet(new CustomShortcutSet(KeyStroke.getKeyStroke(KeyEvent.VK_P, InputEvent.CTRL_DOWN_MASK)), component, impl); if(view.getPresentation().isCodeUsages()) { final GroupByUsageTypeAction groupByUsageTypeAction = new GroupByUsageTypeAction(impl); groupByUsageTypeAction.registerCustomShortcutSet(new CustomShortcutSet(KeyStroke.getKeyStroke(KeyEvent.VK_T, InputEvent.CTRL_DOWN_MASK)), component, impl); return new AnAction[] { groupByUsageTypeAction, groupByScopeAction, groupByModuleTypeAction, groupByPackageAction, groupByFileStructureAction, }; } else { return new AnAction[] { groupByScopeAction, groupByModuleTypeAction, groupByPackageAction, groupByFileStructureAction, }; } }