List of usage examples for com.intellij.openapi.actionSystem CommonShortcuts getRerun
public static ShortcutSet getRerun()
From source file:com.intellij.lang.ant.config.execution.AntBuildMessageView.java
License:Apache License
private JPanel createToolbarPanel() { RunAction runAction = new RunAction(this); runAction.registerCustomShortcutSet(CommonShortcuts.getRerun(), this); DefaultActionGroup leftActionGroup = new DefaultActionGroup(); leftActionGroup.add(runAction);// w w w . j av a2s. com leftActionGroup.add(new PauseOutputAction(this)); leftActionGroup.add(new StopAction(this)); leftActionGroup.add(new PreviousOccurenceToolbarAction(this)); leftActionGroup.add(new NextOccurenceToolbarAction(this)); DefaultActionGroup rightActionGroup = new DefaultActionGroup(); rightActionGroup.add(new ChangeViewAction(this)); rightActionGroup.add(new VerboseAction(this)); rightActionGroup.add(CommonActionsManager.getInstance().createExpandAllAction(myTreeExpander, this)); rightActionGroup.add(CommonActionsManager.getInstance().createCollapseAllAction(myTreeExpander, this)); rightActionGroup.add(myTreeView.createToggleAutoscrollAction()); myLeftToolbar = ActionManager.getInstance().createActionToolbar(ActionPlaces.ANT_MESSAGES_TOOLBAR, leftActionGroup, false); JPanel toolbarPanel = new JPanel(new GridLayout(1, 2, 2, 0)); toolbarPanel.add(myLeftToolbar.getComponent()); myRightToolbar = ActionManager.getInstance().createActionToolbar(ActionPlaces.ANT_MESSAGES_TOOLBAR, rightActionGroup, false); toolbarPanel.add(myRightToolbar.getComponent()); return toolbarPanel; }
From source file:com.microsoft.alm.plugin.idea.common.ui.common.tabs.TabFormImpl.java
License:Open Source License
/** * Create the action buttons for the toolbar * * @return action toolbar/*from w ww .j av a2 s . c o m*/ */ protected DefaultActionGroup createActionsGroup() { final AnAction createAction = new AnAction(TfPluginBundle.message(createDialogTitle), TfPluginBundle.message(createDialogTitle), AllIcons.ToolbarDecorator.Add) { @Override public void actionPerformed(AnActionEvent anActionEvent) { listenerContainer.triggerEvent(this, CMD_CREATE_NEW_ITEM); } }; createAction.registerCustomShortcutSet(CommonShortcuts.getNew(), scrollPanel); //Ctrl+N on windows or Cmd+M on Mac final AnAction refreshAction = new AnAction(TfPluginBundle.message(refreshTooltip), TfPluginBundle.message(refreshTooltip), AllIcons.Actions.Refresh) { @Override public void actionPerformed(AnActionEvent anActionEvent) { listenerContainer.triggerEvent(this, CMD_REFRESH); } }; refreshAction.registerCustomShortcutSet(CommonShortcuts.getRerun(), scrollPanel); //Ctrl+R on windows or Cmd+R on Mac return new DefaultActionGroup(createAction, refreshAction); }
From source file:com.microsoft.alm.plugin.idea.ui.common.tabs.TabFormImpl.java
License:Open Source License
/** * Create the action buttons for the toolbar * * @return action toolbar/*www.j a v a 2 s .co m*/ */ protected DefaultActionGroup createActionsGroup() { final AnAction createAction = new AnAction(TfPluginBundle.message(createDialogTitle), TfPluginBundle.message(createDialogTitle), AllIcons.ToolbarDecorator.Add) { @Override public void actionPerformed(AnActionEvent anActionEvent) { setChangedAndNotify(CMD_CREATE_NEW_ITEM); } }; createAction.registerCustomShortcutSet(CommonShortcuts.getNew(), scrollPanel); //Ctrl+N on windows or Cmd+M on Mac final AnAction refreshAction = new AnAction(TfPluginBundle.message(refreshTooltip), TfPluginBundle.message(refreshTooltip), AllIcons.Actions.Refresh) { @Override public void actionPerformed(AnActionEvent anActionEvent) { setChangedAndNotify(CMD_REFRESH); } }; refreshAction.registerCustomShortcutSet(CommonShortcuts.getRerun(), scrollPanel); //Ctrl+R on windows or Cmd+R on Mac return new DefaultActionGroup(createAction, refreshAction); }
From source file:com.vladsch.MissingInActions.util.CommonUIShortcuts.java
License:Apache License
public static ShortcutSet getRerun() { return CommonShortcuts.getRerun(); }
From source file:net.orfjackal.sbt.plugin.SbtConsole.java
License:Open Source License
public void attachToToolWindow(ToolWindow window) { // org.jetbrains.idea.maven.embedder.MavenConsoleImpl#ensureAttachedToToolWindow SimpleToolWindowPanel toolWindowPanel = new SimpleToolWindowPanel(false, true); JComponent consoleComponent = consoleView.getComponent(); toolWindowPanel.setContent(consoleComponent); StartSbtAction startSbtAction = new StartSbtAction(); toolWindowPanel.setToolbar(createToolbar(startSbtAction)); startSbtAction.registerCustomShortcutSet(CommonShortcuts.getRerun(), consoleComponent); Content content = ContentFactory.SERVICE.getInstance().createContent(toolWindowPanel, title, true); content.putUserData(CONSOLE_KEY, SbtConsole.this); window.getContentManager().addContent(content); window.getContentManager().setSelectedContent(content); removeUnusedTabs(window, content);//from ww w . j a va 2s . co m }
From source file:org.jetbrains.idea.svn.dialogs.PropertiesComponent.java
License:Apache License
public void init() { setLayout(new BorderLayout()); myTable = new JBTable(); myTextArea = new JTextArea(0, 0); myTextArea.setEditable(false);//ww w . java 2 s .c o m JScrollPane scrollPane = ScrollPaneFactory.createScrollPane(myTable); mySplitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT, true, scrollPane, ScrollPaneFactory.createScrollPane(myTextArea)); add(mySplitPane, BorderLayout.CENTER); add(createToolbar(), BorderLayout.WEST); final DefaultTableModel model = new DefaultTableModel(createTableModel(new HashMap<String, String>()), new Object[] { "Name", "Value" }) { public boolean isCellEditable(final int row, final int column) { return false; } }; myTable.setModel(model); myTable.setShowVerticalLines(true); myTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); myTable.getSelectionModel().addListSelectionListener(new ListSelectionListener() { public void valueChanged(ListSelectionEvent e) { int index = myTable.getSelectedRow(); if (index >= 0) { Object value = myTable.getValueAt(index, 1); if (value instanceof String) { myTextArea.setText(((String) value)); } else { myTextArea.setText(""); } } else { myTextArea.setText(""); } } }); myPopupActionGroup = createPopup(); PopupHandler.installPopupHandler(myTable, myPopupActionGroup, ActionPlaces.UNKNOWN, ActionManager.getInstance()); PopupHandler.installPopupHandler(scrollPane, myPopupActionGroup, ActionPlaces.UNKNOWN, ActionManager.getInstance()); final Shortcut[] shortcuts = KeymapManager.getInstance().getActiveKeymap() .getShortcuts(IdeActions.ACTION_CLOSE_ACTIVE_TAB); myCloseAction.registerCustomShortcutSet(new CustomShortcutSet(shortcuts), this); myRefreshAction.registerCustomShortcutSet(CommonShortcuts.getRerun(), this); }
From source file:org.jetbrains.idea.svn.dialogs.RepositoryBrowserDialog.java
License:Apache License
public JComponent createToolbar(final boolean horizontal, final AnAction... additionalActions) { DefaultActionGroup group = new DefaultActionGroup(); final RepositoryBrowserComponent browser = getRepositoryBrowser(); group.add(new AddLocationAction(browser)); group.add(new EditLocationAction()); group.add(new DiscardLocationAction(browser)); group.add(new DetailsAction()); group.addSeparator();//from ww w . java2s . com final RefreshAction refreshAction = new RefreshAction(browser); refreshAction.registerCustomShortcutSet(CommonShortcuts.getRerun(), browser); group.add(refreshAction); copyUrlAction = new CopyUrlAction(); copyUrlAction .registerCustomShortcutSet( new CustomShortcutSet(KeyStroke.getKeyStroke(KeyEvent.VK_INSERT, InputEvent.CTRL_MASK | InputEvent.CTRL_DOWN_MASK | InputEvent.ALT_MASK | InputEvent.ALT_DOWN_MASK)), browser); mkDirAction = new MkDirAction(browser); mkDirAction.registerCustomShortcutSet( new CustomShortcutSet( KeyStroke.getKeyStroke(KeyEvent.VK_INSERT, InputEvent.ALT_MASK | InputEvent.ALT_DOWN_MASK)), browser); AnAction action = CommonActionsManager.getInstance().createCollapseAllAction(new TreeExpander() { public void expandAll() { } public boolean canExpand() { return false; } public void collapseAll() { JTree tree = browser.getRepositoryTree(); int row = tree.getRowCount() - 1; while (row >= 0) { tree.collapseRow(row); row--; } } public boolean canCollapse() { return true; } }, browser); group.add(action); if ((additionalActions != null) || (!horizontal)) { group.addSeparator(); } if (additionalActions != null) { for (AnAction anAction : additionalActions) { group.add(anAction); } } if (!horizontal) { group.add(new CloseToolWindowAction()); } return ActionManager.getInstance().createActionToolbar(PLACE_TOOLBAR, group, horizontal).getComponent(); }
From source file:org.napile.idea.thermit.config.execution.AntBuildMessageView.java
License:Apache License
private JPanel createToolbarPanel() { RunAction runAction = new RunAction(this); runAction.registerCustomShortcutSet(CommonShortcuts.getRerun(), this); DefaultActionGroup leftActionGroup = new DefaultActionGroup(); leftActionGroup.add(runAction);//from w w w. ja v a2 s.co m leftActionGroup.add(new PauseOutputAction(this)); leftActionGroup.add(new StopAction(this)); leftActionGroup.add(new CloseAction()); leftActionGroup.add(new PreviousOccurenceToolbarAction(this)); leftActionGroup.add(new NextOccurenceToolbarAction(this)); leftActionGroup.add(new ContextHelpAction(HelpID.ANT)); DefaultActionGroup rightActionGroup = new DefaultActionGroup(); rightActionGroup.add(new ChangeViewAction(this)); rightActionGroup.add(new VerboseAction(this)); rightActionGroup.add(CommonActionsManager.getInstance().createExpandAllAction(myTreeExpander, this)); rightActionGroup.add(CommonActionsManager.getInstance().createCollapseAllAction(myTreeExpander, this)); rightActionGroup.add(myTreeView.createToggleAutoscrollAction()); myLeftToolbar = ActionManager.getInstance().createActionToolbar(ActionPlaces.ANT_MESSAGES_TOOLBAR, leftActionGroup, false); JPanel toolbarPanel = new JPanel(new GridLayout(1, 2, 2, 0)); toolbarPanel.add(myLeftToolbar.getComponent()); myRightToolbar = ActionManager.getInstance().createActionToolbar(ActionPlaces.ANT_MESSAGES_TOOLBAR, rightActionGroup, false); toolbarPanel.add(myRightToolbar.getComponent()); return toolbarPanel; }