public void initBPMNModelMenu() { DefaultActionGroup modelMenu = (DefaultActionGroup) ActionManager.getInstance().getAction("yaoqiang.actions.BPMNModelMenu"); AppMenu model = new ModelMenu(); for (int i = 0; i < model.getItemCount(); i++) { JMenuItem item = model.getItem(i); if (item == null) { modelMenu.addSeparator(); } else { AnAction action = new AnAction(item.getText()) { @Override public void actionPerformed(AnActionEvent e) { item.getAction().actionPerformed(new ActionEvent(e, 0, "")); } }; modelMenu.add(action); } } }
/** * create ListPop * * @param title * @param data * @param listener */ public void createList(String title, String[] data, OnItemClickListener listener) { DefaultActionGroup group = new DefaultActionGroup(); if (data != null && data.length > 0) { for (int i = 0; i < data.length; i++) { if (!Utils.isEmpty(data[i])) { if (data[i].contains("-")) { group.add(new ListItemAction(i, data[i], listener)); } else { group.addSeparator(data[i]); } } } } listPopup = JBPopupFactory.getInstance().createActionGroupPopup(title, group, anActionEvent.getDataContext(), aid, true, null, -1, null, "unknown"); show(); }
@NotNull default DefaultActionGroup getTaskDescriptionActionGroup() { final DefaultActionGroup group = new DefaultActionGroup(); String[] ids = new String[]{ StudyCheckAction.ACTION_ID, StudyPreviousTaskAction.ACTION_ID, StudyNextTaskAction.ACTION_ID, StudyRefreshTaskFileAction.ACTION_ID, StudyShowHintAction.ACTION_ID }; ActionManager actionManager = ActionManager.getInstance(); Arrays.stream(ids) .map(actionManager::getAction) .filter(Objects::nonNull) .forEach(group::add); group.add(new StudyEditInputAction()); return group; }
@Override public void run(AnActionButton button) { // 获取选中节点 final DefaultMutableTreeNode selectedNode = getSelectedNode(); if (selectedNode == null) { return; } List<AnAction> actions = getMultipleActions(selectedNode); if (actions == null || actions.isEmpty()) { return; } // 显示新增按钮 final DefaultActionGroup group = new DefaultActionGroup(actions); JBPopupFactory.getInstance() .createActionGroupPopup(null, group, DataManager.getInstance().getDataContext(button.getContextComponent()), JBPopupFactory.ActionSelectionAid.SPEEDSEARCH, true).show(button.getPreferredPopupPoint()); }
private Content setUpToolWindow() { //Create runner UI layout final RunnerLayoutUi.Factory factory = RunnerLayoutUi.Factory.getInstance(myProject); final RunnerLayoutUi layoutUi = factory.create("", "", "session", myProject); // Adding actions DefaultActionGroup group = new DefaultActionGroup(); group.add(myKillAction); group.addSeparator(); layoutUi.getOptions().setLeftToolbar(group, ActionPlaces.UNKNOWN); final Content console = layoutUi.createContent(CONSOLE_ID, myConsole.getComponent(), "", null, null); layoutUi.addContent(console, 0, PlaceInGrid.right, false); final JComponent uiComponent = layoutUi.getComponent(); myPanel.add(uiComponent, BorderLayout.CENTER); final ContentManager manager = myToolWindow.getContentManager(); final ContentFactory contentFactory = ContentFactory.SERVICE.getInstance(); final Content content = contentFactory.createContent(uiComponent, null, true); manager.addContent(content); return content; }
@NotNull protected DefaultActionGroup createPopupActionGroup(JComponent button) { DefaultActionGroup group = new DefaultActionGroup(); GuiEditor editor = myLastEditor; if (editor != null) { Locale[] locales = FormEditingUtil.collectUsedLocales(editor.getModule(), editor.getRootContainer()); if (locales.length > 1 || (locales.length == 1 && locales [0].getDisplayName().length() > 0)) { Arrays.sort(locales, new Comparator<Locale>() { public int compare(final Locale o1, final Locale o2) { return o1.getDisplayName().compareTo(o2.getDisplayName()); } }); for(Locale locale: locales) { group.add(new SetLocaleAction(editor, locale, true)); } } else { group.add(new SetLocaleAction(editor, new Locale(""), false)); } } return group; }
@Override public void disposeComponent() { ActionManager am = ActionManager.getInstance(); // Gets an instance of the WindowMenu action group. DefaultActionGroup menuManager = (DefaultActionGroup) am.getAction(COMPONENT_GROUP); //(IdeActions.GROUP_EDITOR_POPUP); //"EditorPopupMenu"); for (AnAction a : menuManager.getChildActionsOrStubs()) { if (a.getClass() == LaunchSearchAction.class) { am.unregisterAction(getActionId((LaunchSearchAction) a)); } } // Adds a separator and a new menu command to the WindowMenu group on the main menu. menuManager.removeAll(); }
@Override public AbstractAddGroup createAddAction() { return new AbstractAddGroup(ProjectBundle.message("add.new.jdk.text")) { @NotNull @Override public AnAction[] getChildren(@Nullable final AnActionEvent e) { DefaultActionGroup group = new DefaultActionGroup(ProjectBundle.message("add.new.jdk.text"), true); myJdksTreeModel.createAddActions(group, myTree, new Consumer<Sdk>() { @Override public void consume(final Sdk projectJdk) { addJdkNode(projectJdk, true); } }); return group.getChildren(null); } }; }
@Override @Nullable protected ArrayList<AnAction> createActions(final boolean fromPopup) { if (myProjectJdksModel == null) { return null; } final ArrayList<AnAction> actions = new ArrayList<AnAction>(); DefaultActionGroup group = new DefaultActionGroup(ProjectBundle.message("add.new.jdk.text"), true); group.getTemplatePresentation().setIcon(IconUtil.getAddIcon()); myProjectJdksModel.createAddActions(group, myTree, new Consumer<Sdk>() { @Override public void consume(final Sdk projectJdk) { addNode(new MyNode(new JdkConfigurable(((ProjectJdkImpl)projectJdk), myProjectJdksModel, TREE_UPDATER, myHistory, myProject), false), myRoot); selectNodeInTree(findNodeByObject(myRoot, projectJdk)); } }); actions.add(new MyActionGroupWrapper(group)); actions.add(new MyDeleteAction(Conditions.<Object[]>alwaysTrue())); return actions; }
private void onNewButton() { if (myCloudTypes.size() == 1) { createAccount(ContainerUtil.getFirstItem(myCloudTypes)); return; } DefaultActionGroup group = new DefaultActionGroup(); for (final ServerType<?> cloudType : myCloudTypes) { group.add(new AnAction(cloudType.getPresentableName(), cloudType.getPresentableName(), cloudType.getIcon()) { @Override public void actionPerformed(AnActionEvent e) { createAccount(cloudType); } }); } JBPopupFactory.getInstance().createActionGroupPopup("New Account", group, DataManager.getInstance().getDataContext(myMainPanel), JBPopupFactory.ActionSelectionAid.SPEEDSEARCH, false) .showUnderneathOf(myNewButton); }
public DefaultActionGroup createDefaultFileSystemActions(FileSystemTree fileSystemTree) { DefaultActionGroup group = new DefaultActionGroup(); final ActionManager actionManager = ActionManager.getInstance(); group.add(actionManager.getAction("FileChooser.GotoHome")); group.add(actionManager.getAction("FileChooser.GotoProject")); group.addSeparator(); group.add(actionManager.getAction("FileChooser.NewFolder")); group.add(actionManager.getAction("FileChooser.Delete")); group.addSeparator(); SynchronizeAction action1 = new SynchronizeAction(); AnAction original = actionManager.getAction(IdeActions.ACTION_SYNCHRONIZE); action1.copyFrom(original); action1.registerCustomShortcutSet(original.getShortcutSet(), fileSystemTree.getTree()); group.add(action1); group.addSeparator(); group.add(actionManager.getAction("FileChooser.ShowHiddens")); return group; }
protected void selectionChanged(RadComponent component, boolean selected) { ListenerNavigateButton btn = myNavigateButtons.get(component); if (selected) { DefaultActionGroup group = component.getBinding() != null ? ListenerNavigateButton.prepareActionGroup(component) : null; if (group != null && group.getChildrenCount() > 0) { if (btn == null) { btn = new ListenerNavigateButton(component); myNavigateButtons.put(component, btn); } add(btn); btn.setVisible(true); } else { if (btn != null) { btn.setVisible(false); } } } else { if (btn != null) { btn.setVisible(false); } } }
private static int getChildrenCountRecursive(ActionGroup group) { AnAction[] children; if (group instanceof DefaultActionGroup) { children = ((DefaultActionGroup) group).getChildActionsOrStubs(); } else { children = group.getChildren(null); } int count = 0; for (AnAction child : children) { if (child instanceof ActionGroup) { count += getChildrenCountRecursive((ActionGroup) child); } else { count++; } } return count; }
public void createToolWindowContent(@NotNull ToolWindow toolWindow) { //Create runner UI layout RunnerLayoutUi.Factory factory = RunnerLayoutUi.Factory.getInstance(myProject); RunnerLayoutUi layoutUi = factory.create("", "", "session", myProject); // Adding actions DefaultActionGroup group = new DefaultActionGroup(); layoutUi.getOptions().setLeftToolbar(group, ActionPlaces.UNKNOWN); Content console = layoutUi.createContent(GradleConsoleToolWindowFactory.ID, myConsoleView.getComponent(), "", null, null); AnAction[] consoleActions = myConsoleView.createConsoleActions(); for (AnAction action : consoleActions) { if (!shouldIgnoreAction(action)) { group.add(action); } } layoutUi.addContent(console, 0, PlaceInGrid.right, false); JComponent layoutComponent = layoutUi.getComponent(); myConsolePanel.add(layoutComponent, BorderLayout.CENTER); //noinspection ConstantConditions Content content = ContentFactory.SERVICE.getInstance().createContent(layoutComponent, null, true); toolWindow.getContentManager().addContent(content); }
private ActionToolbarImpl createToolbar() { final DefaultActionGroup framesGroup = new DefaultActionGroup(); CommonActionsManager actionsManager = CommonActionsManager.getInstance(); framesGroup.add(actionsManager.createPrevOccurenceAction(getFramesList())); framesGroup.add(actionsManager.createNextOccurenceAction(getFramesList())); framesGroup.addAll(ActionManager.getInstance().getAction(XDebuggerActions.FRAMES_TOP_TOOLBAR_GROUP)); final ActionToolbarImpl toolbar = (ActionToolbarImpl)ActionManager.getInstance().createActionToolbar(ActionPlaces.DEBUGGER_TOOLBAR, framesGroup, true); toolbar.setReservePlaceAutoPopupIcon(false); toolbar.setAddSeparatorFirst(true); toolbar.getComponent().setBorder(new EmptyBorder(1, 0, 0, 0)); return toolbar; }
public ContentEntryTreeEditor(Project project, List<ModuleSourceRootEditHandler<?>> editHandlers) { myProject = project; myEditHandlers = editHandlers; myTree = new Tree(); myTree.setRootVisible(true); myTree.setShowsRootHandles(true); myEditingActionsGroup = new DefaultActionGroup(); TreeUtil.installActions(myTree); new TreeSpeedSearch(myTree); myTreePanel = new MyPanel(new BorderLayout()); final JScrollPane scrollPane = ScrollPaneFactory.createScrollPane(myTree); myTreePanel.add(scrollPane, BorderLayout.CENTER); myTreePanel.setVisible(false); myDescriptor = FileChooserDescriptorFactory.createMultipleFoldersDescriptor(); myDescriptor.setShowFileSystemRoots(false); }
private StructureTabComponent(Disposable disposable) { super("Structure"); myEventModel = new GeneratedStructureModel(); final StructureTree tree = new StructureTree(myEventModel); myComponent = ScrollPaneFactory.createScrollPane(tree); myEventModel.addTreeModelListener(new SmartStructureTracker(tree, disposable)); final DefaultActionGroup structureActions = new DefaultActionGroup(); final StructureTreeExpander expander = new StructureTreeExpander(tree); final CommonActionsManager actionsManager = CommonActionsManager.getInstance(); structureActions.add(new HideWhitespaceAction(tree, myEventModel)); structureActions.add(actionsManager.createExpandAllAction(expander, tree)); structureActions.add(actionsManager.createCollapseAllAction(expander, tree)); myToolbarActions = structureActions; }
private void fillActionGroup(final DefaultActionGroup group, final List<NamedScope> scopes, final List<Descriptor> defaultDescriptors, final InspectionProfileImpl inspectionProfile, final Set<String> excludedScopeNames) { for (final NamedScope scope : scopes) { final String scopeName = scope.getName(); if (excludedScopeNames.contains(scopeName)) { continue; } group.add(new DumbAwareAction(scopeName) { @Override public void actionPerformed(final AnActionEvent e) { for (final Descriptor defaultDescriptor : defaultDescriptors) { inspectionProfile.addScope(defaultDescriptor.getToolWrapper().createCopy(), scope, defaultDescriptor.getLevel(), true, getEventProject(e)); } onScopeAdded(); } }); } }
@NotNull @Override protected DefaultActionGroup createPopupActionGroup(JComponent button) { Iterator<? extends RadViewComponent> iterator = myComponents.iterator(); int flags = 0; if (iterator.hasNext()) { flags = Gravity.getFlags(iterator.next()); while (iterator.hasNext()) { if (flags != Gravity.getFlags(iterator.next())) { flags = 0; break; } } } mySelection = Gravity.flagToValues(flags); return super.createPopupActionGroup(button); }
public static DefaultActionGroup create(@NotNull Project p, @NotNull final DeviceContext context) { DefaultActionGroup group = new DefaultActionGroup("System Information", true) { @Override public void update(AnActionEvent e) { e.getPresentation().setText("System Information"); e.getPresentation().setIcon(AndroidIcons.Ddms.SysInfo); e.getPresentation().setEnabled(context.getSelectedDevice() != null); } @Override public boolean isDumbAware() { return true; } }; group.add(new MyDumpSysAction(p, context, "activity", "Activity Manager State")); group.add(new MyDumpSysAction(p, context, "package", "Package Information")); group.add(new MyDumpSysAction(p, context, "meminfo", "Memory Usage")); group.add(new MyDumpProcStatsAction(p, context, "procstats", "Memory use over time")); group.add(new MyDumpSysAction(p, context, "gfxinfo", "Graphics State")); return group; }
@Override public void addContainerSelectionActions(DesignerEditorPanel designer, DefaultActionGroup actionGroup, List<? extends RadViewComponent> selection) { // Add in the selection actions on the child if (!myContainer.getChildren().isEmpty()) { RadComponent component = myContainer.getChildren().get(0); RadLayout layout = component.getLayout(); if (layout instanceof RadViewLayout) { ((RadViewLayout) layout).addContainerSelectionActions(designer, actionGroup, Collections.<RadViewComponent>emptyList()); if (component instanceof RadViewComponent) { RadViewLayout.addFillActions(designer, actionGroup, Collections.singletonList((RadViewComponent) component)); } } } else { super.addContainerSelectionActions(designer, actionGroup, selection); } }
/** * Create some actions * * @param horizontal is horizontal displayed * @return */ public static ActionToolbar createToolbarWithActions(boolean horizontal, AnAction... actions) { DefaultActionGroup group = new DefaultActionGroup(); if (actions != null) { for (AnAction anAction : actions) { group.add(anAction); } } //group.addSeparator(); return ActionManager.getInstance().createActionToolbar("unknown", group, horizontal);// horizontal }
@NotNull private ActionGroup createActionToolbar(JComponent consolePanel, ConsoleView consoleView, @NotNull final RunnerLayoutUi myUi, RunContentDescriptor contentDescriptor, Executor runExecutorInstance) { final DefaultActionGroup actionGroup = new DefaultActionGroup(); actionGroup.add(new FilterAction()); actionGroup.add(new RerunAction(consolePanel, consoleView)); actionGroup.add(new StopAction()); actionGroup.add(new FormatAction()); actionGroup.add(new MyCloseAction(runExecutorInstance, contentDescriptor, myProject)); return actionGroup; }
public ActionToolbar createToolbar() { DefaultActionGroup group = new DefaultActionGroup(); group.add(new ScrollToTheEndToolbarAction(this.getEditor())); group.add(new ClearLogAction(this)); group.add(new StartAction(this, getProject())); ActionToolbar toolbar = ActionManager.getInstance().createActionToolbar("left", group, false); toolbar.setTargetComponent(this.getComponent()); return toolbar; }
public static ActionToolbar createActionToolbar(Tree componentsTree) { DefaultActionGroup defaultActionGroup = new DefaultActionGroup(); defaultActionGroup.addAction(ActionManager.getInstance().getAction("Xray.Refresh")); defaultActionGroup.addAction(new CollapseAllAction(componentsTree)); defaultActionGroup.addAction(new ExpandAllAction(componentsTree)); return ActionManager.getInstance().createActionToolbar(ActionPlaces.CHANGES_VIEW_TOOLBAR, defaultActionGroup, true); }
@Override public void actionPerformed(AnActionEvent e) { AbstractNewProjectDialog dialog = new AbstractNewProjectDialog() { @Override protected DefaultActionGroup createRootStep() { return new PyCCCreateCourseProjectStep(); } }; dialog.show(); }
@NotNull @Override public DefaultActionGroup getTaskDescriptionActionGroup() { DefaultActionGroup taskDescriptionActionGroup = super.getTaskDescriptionActionGroup(); taskDescriptionActionGroup.remove(ActionManager.getInstance().getAction(StudyShowHintAction.ACTION_ID)); StudyFillPlaceholdersAction fillPlaceholdersAction = new StudyFillPlaceholdersAction(); fillPlaceholdersAction.getTemplatePresentation().setIcon(EduKotlinIcons.FILL_PLACEHOLDERS_ICON); fillPlaceholdersAction.getTemplatePresentation().setText("Fill Answer Placeholders"); taskDescriptionActionGroup.add(fillPlaceholdersAction); return taskDescriptionActionGroup; }
private void initToolWindow() { initTree(); JPanel panel = new SeedStackNavigatorPanel(myProject, tree); final ToolWindowManagerEx manager = ToolWindowManagerEx.getInstanceEx(myProject); toolWindow = (ToolWindowEx) manager.registerToolWindow(TOOL_WINDOW_ID, false, ToolWindowAnchor.LEFT, myProject, true); toolWindow.setIcon(SeedStackIcons.LOGO); final ContentFactory contentFactory = ServiceManager.getService(ContentFactory.class); final Content content = contentFactory.createContent(panel, "", false); ContentManager contentManager = toolWindow.getContentManager(); contentManager.addContent(content); contentManager.setSelectedContent(content, false); final ToolWindowManagerAdapter listener = new ToolWindowManagerAdapter() { boolean wasVisible = false; @Override public void stateChanged() { if (toolWindow.isDisposed()) return; boolean visible = toolWindow.isVisible(); if (!visible) { return; } scheduleStructureUpdate(null); } }; manager.addToolWindowManagerListener(listener, myProject); ActionManager actionManager = ActionManager.getInstance(); DefaultActionGroup group = new DefaultActionGroup(); toolWindow.setAdditionalGearActions(group); }
SeedStackNavigatorPanel(Project project, SimpleTree tree) { super(true, true); this.project = project; this.tree = tree; final ActionManager actionManager = ActionManager.getInstance(); ActionToolbar actionToolbar = actionManager.createActionToolbar( "SeedStack Navigator Toolbar", (DefaultActionGroup) actionManager.getAction("SeedStack.NavigatorActionsToolbar"), true ); actionToolbar.setTargetComponent(tree); setToolbar(actionToolbar.getComponent()); setContent(ScrollPaneFactory.createScrollPane(tree)); }
public static ActionPopupMenu createShortPopupForRepositoryDialog(RepositoryBrowserComponent browserComponent) { DefaultActionGroup group = new DefaultActionGroup(); DefaultActionGroup newGroup = new DefaultActionGroup("_New", true); newGroup.add(new AddLocationAction(browserComponent)); newGroup.add(new MkDirAction(browserComponent)); group.add(newGroup); group.addSeparator(); group.add(new RefreshAction(browserComponent)); group.add(new DiscardLocationAction(browserComponent)); group.add(new DeleteAction(browserComponent)); return ActionManager.getInstance().createActionPopupMenu("", group); }
@Override protected void fillActions(Project project, @NotNull DefaultActionGroup defaultActionGroup, @NotNull DataContext dataContext) { if (project == null) { return; } addAction("com.dim.action.PullDatabaseAction", defaultActionGroup); addAction("com.dim.action.PullPreferenceAction", defaultActionGroup); addAction("com.dim.action.PullAnrAction", defaultActionGroup); addAction("com.dim.action.PullTraceMethodAction", defaultActionGroup); addAction("com.dim.action.PushAction", defaultActionGroup); }
/** * Create a list of idea actions that the user can choose, to change their pairs. * * @param pairController Pair logic controller for list of members. * @return list of actions. */ private static ActionGroup createActions(@NotNull PairController pairController, @NotNull TeamMemberAction.TeamMemberActionPerformer teamMemberActionPerformer) { DefaultActionGroup defaultActionGroup = new DefaultActionGroup(null, false); PairConfig pairConfig = pairController.getPairConfig(); for (TeamMember teamMember : pairConfig.getTeamMembers()) { defaultActionGroup.add(new TeamMemberAction(teamMember, teamMemberActionPerformer)); } return defaultActionGroup; }
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)); } }
/** * 创建左侧工具栏 * * @param terminalRunner * @param terminal * @param toolWindow * @return */ private ActionToolbar createToolbar(@Nullable AbstractTerminalRunner terminalRunner, @NotNull JBTabbedTerminalWidget terminal, @NotNull ToolWindow toolWindow) { DefaultActionGroup group = new DefaultActionGroup(); if (terminalRunner != null) { group.add(new RunAction(this)); group.add(new StopAction(this)); group.addSeparator(); group.add(new ClearAction(this)); } return ActionManager.getInstance().createActionToolbar("unknown", group, false); }
@NotNull private ActionGroup createActionToolbar(JComponent consolePanel, ConsoleView consoleView, @NotNull final RunnerLayoutUi myUi, RunContentDescriptor contentDescriptor, Executor runExecutorInstance) { final DefaultActionGroup actionGroup = new DefaultActionGroup(); actionGroup.add(new RerunAction(consolePanel, consoleView)); actionGroup.add(new StopAction()); actionGroup.add(new FormatAction()); actionGroup.add(new MyCloseAction(runExecutorInstance, contentDescriptor, myProject)); return actionGroup; }
public void createToolWindowContent(ToolWindow toolWindow) { // Create runner UI layout RunnerLayoutUi.Factory factory = RunnerLayoutUi.Factory.getInstance(project); RunnerLayoutUi layoutUi = factory.create("", "", "session", project); Content console = layoutUi.createContent( BlazeConsoleToolWindowFactory.ID, consoleView.getComponent(), "", null, null); console.setCloseable(false); layoutUi.addContent(console, 0, PlaceInGrid.right, false); // Adding actions DefaultActionGroup group = new DefaultActionGroup(); layoutUi.getOptions().setLeftToolbar(group, ActionPlaces.UNKNOWN); AnAction[] consoleActions = consoleView.createConsoleActions(); for (AnAction action : consoleActions) { if (!shouldIgnoreAction(action)) { group.add(action); } } group.add(new StopAction()); JComponent layoutComponent = layoutUi.getComponent(); //noinspection ConstantConditions Content content = ContentFactory.SERVICE.getInstance().createContent(layoutComponent, null, true); content.setCloseable(false); toolWindow.getContentManager().addContent(content); }
public ConfigurationToolBar(AndroidLayoutPreviewToolWindowForm previewWindow) { myPreviewWindow = previewWindow; DefaultActionGroup group = createActions(myPreviewWindow); ActionToolbar toolbar = createToolBar(group); setLayout(new BorderLayout()); add(toolbar.getComponent(), BorderLayout.CENTER); }
public static void showNavigatePopup(final RadComponent component, final boolean showIfEmpty) { final DefaultActionGroup actionGroup = prepareActionGroup(component); if (actionGroup != null && actionGroup.getChildrenCount() == 0 && showIfEmpty) { actionGroup.add(new MyNavigateAction(UIDesignerBundle.message("navigate.to.listener.empty"), null)); } if (actionGroup != null && actionGroup.getChildrenCount() > 0) { final DataContext context = DataManager.getInstance().getDataContext(component.getDelegee()); final JBPopupFactory factory = JBPopupFactory.getInstance(); final ListPopup popup = factory.createActionGroupPopup(UIDesignerBundle.message("navigate.to.listener.title"), actionGroup, context, JBPopupFactory.ActionSelectionAid.NUMBERING, true); FormEditingUtil.showPopupUnderComponent(popup, component); } }
@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())); }
public static void addThreadDump(Project project, List<ThreadState> threads, final RunnerLayoutUi ui, DebuggerSession session) { final TextConsoleBuilder consoleBuilder = TextConsoleBuilderFactory.getInstance().createBuilder(project); consoleBuilder.filters(ExceptionFilters.getFilters(session.getSearchScope())); final ConsoleView consoleView = consoleBuilder.getConsole(); final DefaultActionGroup toolbarActions = new DefaultActionGroup(); consoleView.allowHeavyFilters(); final ThreadDumpPanel panel = new ThreadDumpPanel(project, consoleView, toolbarActions, threads); final String id = THREAD_DUMP_CONTENT_PREFIX + " #" + myCurrentThreadDumpId; final Content content = ui.createContent(id, panel, id, null, null); content.putUserData(RunnerContentUi.LIGHTWEIGHT_CONTENT_MARKER, Boolean.TRUE); content.setCloseable(true); content.setDescription("Thread Dump"); ui.addContent(content); ui.selectAndFocus(content, true, true); myThreadDumpsCount++; myCurrentThreadDumpId++; Disposer.register(content, new Disposable() { @Override public void dispose() { myThreadDumpsCount--; if (myThreadDumpsCount == 0) { myCurrentThreadDumpId = 1; } } }); Disposer.register(content, consoleView); ui.selectAndFocus(content, true, false); if (threads.size() > 0) { panel.selectStackFrame(0); } }