private JPanel createToolbarPanel() { final DefaultActionGroup group = new DefaultActionGroup(); group.add(new AddAction()); group.add(new RemoveAction()); group.add(new RunAction()); group.add(myAntBuildFilePropertiesAction); group.addSeparator(); group.add(new ShowAllTargetsAction()); group.add(new ShowModuleGrouping()); AnAction action = CommonActionsManager.getInstance().createExpandAllAction(myTreeExpander, this); action.getTemplatePresentation().setDescription(AntBundle.message("ant.explorer.expand.all.nodes.action.description")); group.add(action); action = CommonActionsManager.getInstance().createCollapseAllAction(myTreeExpander, this); action.getTemplatePresentation().setDescription(AntBundle.message("ant.explorer.collapse.all.nodes.action.description")); group.add(action); group.addSeparator(); group.add(new ContextHelpAction(HelpID.ANT)); final ActionToolbar actionToolBar = ActionManager.getInstance().createActionToolbar(ActionPlaces.ANT_EXPLORER_TOOLBAR, group, true); final JPanel buttonsPanel = new JPanel(new BorderLayout()); buttonsPanel.add(actionToolBar.getComponent(), BorderLayout.CENTER); return buttonsPanel; }
private JPanel createToolbarPanel() { RunAction runAction = new RunAction(this); runAction.registerCustomShortcutSet(CommonShortcuts.getRerun(), this); DefaultActionGroup leftActionGroup = new DefaultActionGroup(); leftActionGroup.add(runAction); 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; }
public Object getData(String dataId) { Object data = myCurrentView.getData(dataId); if (data != null) { return data; } if (PlatformDataKeys.HELP_ID.is(dataId)) { return HelpID.ANT; } else if (PlatformDataKeys.TREE_EXPANDER.is(dataId)) { return myTreeExpander; } return null; }
public Object getData(String dataId) { Object data = myCurrentView.getData(dataId); if (data != null) return data; if (PlatformDataKeys.HELP_ID.is(dataId)) { return HelpID.ANT; } else if (PlatformDataKeys.TREE_EXPANDER.is(dataId)) { return myTreeExpander; } return null; }
@Override public Object getData(Key<?> dataId) { Object data = myCurrentView.getData(dataId); if (data != null) return data; if (PlatformDataKeys.HELP_ID == dataId) { return HelpID.ANT; } else if (PlatformDataKeys.TREE_EXPANDER == dataId) { return myTreeExpander; } return null; }