void composeActions() { removeAll(); configPath = pluginSettings.configFile; try { if (configPath == null || configPath.isEmpty()) { add(new DumbAction("Plugin is not set up"), Constraints.FIRST); } else { Configuration config = readConfig(); addActions(config); } } catch (Exception e) { add(dumbAction, Constraints.FIRST); } finally { add(new PluginSettingsActionGroup(pluginSettings)); add(reloadAction, Constraints.LAST); } }
public WorkItemQueryDropDown(final Project project) { super(); this.project = project; this.defaultQuery = new QueryAction(TfPluginBundle.message(TfPluginBundle.KEY_VCS_WIT_QUERY_DEFAULT_QUERY), WorkItemHelper.getAssignedToMeQuery()); this.loadingAction = new LoadingAction(); this.queryOperationInput = new WorkItemQueriesLookupOperation.QueryInputs(WorkItemQueriesLookupOperation.QueryRootDirectories.MY_QUERIES); // set defaults for dropdown entries this.group.add(defaultQuery, Constraints.FIRST); this.group.addSeparator(TfPluginBundle.message(TfPluginBundle.KEY_VCS_WIT_QUERY_SEPARATOR_MY_QUERIES)); this.group.add(loadingAction, Constraints.LAST); this.selectedQuery = defaultQuery; initializeUI(); // default to false enableDropDown(false); }
@Override protected void fillToolbarActions(DefaultActionGroup group) { super.fillToolbarActions(group); if(myToImplement) { return; } ToggleAction sortByOverridingAction = new MySortByOverridingAction(); if(mySortedByOverriding) { changeSortComparator(PsiMethodWithOverridingPercentMember.COMPARATOR); } group.add(sortByOverridingAction, Constraints.FIRST); myMergeAction = new MyMergeAction(); group.add(myMergeAction); }
public ProcessActionGroup(Process process, RemoteClient remoteClient) { super(process.getProcessName(), true); final CopyClassesToRemoteAction copyClasses = new CopyClassesToRemoteAction(remoteClient, process); add(copyClasses); final RestartRemoteProcessAction restart = new RestartRemoteProcessAction(remoteClient, process); add(restart); add(new CleanRemotePatchesAction(remoteClient, process)); if (copyClasses != null) { add(new CopyClassesAndRestartRemoteProcessAction(copyClasses, restart), Constraints.FIRST); } final CopyFilesToRemotePathActionGroup copyFiles = new CopyFilesToRemotePathActionGroup(remoteClient, process.getRemoteDirectories(), process.getTemporaryDirectory()); add(copyFiles); }
public void initComponent() { ActionManager am = ActionManager.getInstance(); // for debugging // Notifications.Bus.notify(new Notification(notificationGroupId, "Loading " + InstantPatchRemotePluginRegistration.shortName, "Loading started...", NotificationType.INFORMATION, NotificationListener.URL_OPENING_LISTENER)); try { final RemoteOperationRootGroup rootAction = new RemoteOperationRootGroup(pluginSettings); // Passes an instance of your custom TextBoxes class to the registerAction method of the ActionManager class. am.registerAction(RemoteOperationRootGroup.class.getName(), rootAction); final AnAction ProjectViewPopupMenuAction = am.getAction("ProjectViewPopupMenu"); if (!(ProjectViewPopupMenuAction instanceof DefaultActionGroup)) { System.err.print("ProjectViewPopupMenu is not instanceof DefaultActionGroup, but " + ProjectViewPopupMenuAction.getClass()); } final DefaultActionGroup ProjectViewPopupMenuGroup = (DefaultActionGroup) ProjectViewPopupMenuAction; ProjectViewPopupMenuGroup.add(new Separator(), Constraints.FIRST); ProjectViewPopupMenuGroup.add(rootAction, Constraints.FIRST); // for debugging // Notifications.Bus.notify(new Notification(notificationGroupId, "Loading " + InstantPatchRemotePluginRegistration.shortName, "Loading finished...", NotificationType.INFORMATION, NotificationListener.URL_OPENING_LISTENER)); } catch (Exception e) { System.err.println("Exception happened while registering root action group: " + e); Notifications.Bus.notify(new Notification(InstantPatchRemotePluginRegistration.notificationGroupId, "Loading " + InstantPatchRemotePluginRegistration.shortName, "Loading error: " + e.toString(), NotificationType.ERROR, NotificationListener.URL_OPENING_LISTENER)); } }
@Override public void initActions(RunContentDescriptor content, DefaultActionGroup actionGroup) { Executor executor = myExecutionEnvironment.getExecutor(); actionGroup.add(ActionManager.getInstance().getAction(IdeActions.ACTION_RERUN), Constraints.FIRST); actionGroup.add(new CloseAction(executor, content, myExecutionEnvironment.getProject())); actionGroup.add(new ContextHelpAction(executor.getHelpId())); }
protected void populateDropDownMenu() { isLoading = true; group.removeAll(); // add initial items to menu group.add(defaultQuery, Constraints.FIRST); group.addSeparator(TfPluginBundle.message(TfPluginBundle.KEY_VCS_WIT_QUERY_SEPARATOR_MY_QUERIES)); group.add(loadingAction, Constraints.LAST); // persist an existing selected query if there is one selectedQuery = selectedQuery == null ? defaultQuery : selectedQuery; // add menu items from server addQueriesFromServer(group); }
@Override public void initActions(RunContentDescriptor content, DefaultActionGroup actionGroup) { RestartAction restartAction = new RestartAction(myExecutor, myRunner, content, myExecutionEnvironment); actionGroup.add(restartAction, Constraints.FIRST); restartAction.registerShortcut(content.getComponent()); actionGroup.add(new CloseAction(myExecutor, content, myProject)); actionGroup.add(new ContextHelpAction(myExecutor.getHelpId())); }
@Override public void registerAdditionalActions(@NotNull DefaultActionGroup leftToolbar, @NotNull DefaultActionGroup topToolbar, @NotNull DefaultActionGroup settings) { Constraints beforeRunner = new Constraints(Anchor.BEFORE, "Runner.Layout"); leftToolbar.add(AnSeparator.getInstance(), beforeRunner); leftToolbar.add(ActionManager.getInstance().getAction(DebuggerActions.DUMP_THREADS), beforeRunner); leftToolbar.add(AnSeparator.getInstance(), beforeRunner); Constraints beforeSort = new Constraints(Anchor.BEFORE, "XDebugger.ToggleSortValues"); settings.addAction(new WatchLastMethodReturnValueAction(), beforeSort); settings.addAction(new AutoVarsSwitchAction(), beforeSort); }
@Override public void registerAdditionalActions( @NotNull DefaultActionGroup leftToolbar, @NotNull DefaultActionGroup topToolbar, @NotNull DefaultActionGroup settings) { ActionManager manager = ActionManager.getInstance(); leftToolbar.add( new SaveAndExitAction(), new Constraints(Anchor.AFTER, IdeActions.ACTION_STOP_PROGRAM)); leftToolbar.remove(manager.getAction(IdeActions.ACTION_RERUN)); leftToolbar.remove(manager.getAction(IdeActions.ACTION_STOP_PROGRAM)); // XDebugSessionTab puts this action second from end. AnAction[] actions = leftToolbar.getChildActionsOrStubs(); for (AnAction action : actions) { String text = action.getTemplatePresentation().getText(); if (ExecutionBundle.message("close.tab.action.name").equals(text)) { leftToolbar.remove(action); break; } } // remove help button since it points to the IntelliJ help by default and we don't have // a help page yet. // for some reason, the help button's key in leftToolbar is null, so we need to remove it // by class name. // https://github.com/GoogleCloudPlatform/gcloud-intellij/issues/149 for (AnAction child : leftToolbar.getChildActionsOrStubs()) { if (child .getClass() .getCanonicalName() .equalsIgnoreCase("com.intellij.ide.actions.ContextHelpAction")) { // we never want to show IDEA's help. leftToolbar.remove(child); // show our help if we have it. String helpUrl = GctBundle.getString("clouddebug.helpurl"); if (!"".equals(helpUrl)) { leftToolbar.add(new CloudDebugHelpAction(helpUrl)); } break; } } leftToolbar.remove(manager.getAction(XDebuggerActions.RESUME)); leftToolbar.remove(manager.getAction(XDebuggerActions.PAUSE)); leftToolbar.remove(manager.getAction(XDebuggerActions.MUTE_BREAKPOINTS)); topToolbar.remove(manager.getAction(XDebuggerActions.STEP_OVER)); topToolbar.remove(manager.getAction(XDebuggerActions.STEP_INTO)); topToolbar.remove(manager.getAction(XDebuggerActions.FORCE_STEP_INTO)); topToolbar.remove(manager.getAction(XDebuggerActions.STEP_OUT)); topToolbar.remove(manager.getAction(XDebuggerActions.RUN_TO_CURSOR)); topToolbar.remove(manager.getAction(XDebuggerActions.EVALUATE_EXPRESSION)); topToolbar.remove(manager.getAction(DebuggerActions.POP_FRAME)); }