本文整理汇总了Java中com.intellij.openapi.actionSystem.ActionGroup类的典型用法代码示例。如果您正苦于以下问题:Java ActionGroup类的具体用法?Java ActionGroup怎么用?Java ActionGroup使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ActionGroup类属于com.intellij.openapi.actionSystem包,在下文中一共展示了ActionGroup类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createTrees
import com.intellij.openapi.actionSystem.ActionGroup; //导入依赖的package包/类
@Override
protected void createTrees(@NotNull final Map<String, JTree> type2TreeMap) {
ActionGroup group = (ActionGroup)ActionManager.getInstance().getAction(IdeActions.GROUP_CALL_HIERARCHY_POPUP);
final JTree tree1 = createTree(false);
PopupHandler.installPopupHandler(tree1, group, ActionPlaces.CALL_HIERARCHY_VIEW_POPUP, ActionManager.getInstance());
final BaseOnThisMethodAction baseOnThisMethodAction = new BaseOnThisMethodAction();
baseOnThisMethodAction
.registerCustomShortcutSet(ActionManager.getInstance().getAction(IdeActions.ACTION_CALL_HIERARCHY).getShortcutSet(), tree1);
type2TreeMap.put(CALLEE_TYPE, tree1);
final JTree tree2 = createTree(false);
PopupHandler.installPopupHandler(tree2, group, ActionPlaces.CALL_HIERARCHY_VIEW_POPUP, ActionManager.getInstance());
baseOnThisMethodAction
.registerCustomShortcutSet(ActionManager.getInstance().getAction(IdeActions.ACTION_CALL_HIERARCHY).getShortcutSet(), tree2);
type2TreeMap.put(CALLER_TYPE, tree2);
}
示例2: createConsole
import com.intellij.openapi.actionSystem.ActionGroup; //导入依赖的package包/类
private void createConsole(@NotNull final NetService netService) {
TextConsoleBuilder consoleBuilder = TextConsoleBuilderFactory.getInstance().createBuilder(netService.getProject());
netService.configureConsole(consoleBuilder);
console = consoleBuilder.getConsole();
ApplicationManager.getApplication().invokeLater(new Runnable() {
@Override
public void run() {
ActionGroup actionGroup = netService.getConsoleToolWindowActions();
ActionToolbar toolbar = ActionManager.getInstance().createActionToolbar(ActionPlaces.UNKNOWN, actionGroup, false);
SimpleToolWindowPanel toolWindowPanel = new SimpleToolWindowPanel(false, true);
toolWindowPanel.setContent(console.getComponent());
toolWindowPanel.setToolbar(toolbar.getComponent());
ToolWindow toolWindow = ToolWindowManager.getInstance(netService.getProject())
.registerToolWindow(netService.getConsoleToolWindowId(), false, ToolWindowAnchor.BOTTOM, netService.getProject(), true);
toolWindow.setIcon(netService.getConsoleToolWindowIcon());
Content content = ContentFactory.SERVICE.getInstance().createContent(toolWindowPanel, "", false);
Disposer.register(content, console);
toolWindow.getContentManager().addContent(content);
}
}, netService.getProject().getDisposed());
}
示例3: getChildrenCountRecursive
import com.intellij.openapi.actionSystem.ActionGroup; //导入依赖的package包/类
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;
}
示例4: readExternal
import com.intellij.openapi.actionSystem.ActionGroup; //导入依赖的package包/类
@Override
public void readExternal(Element element) throws InvalidDataException {
myGroupPath = new ArrayList<String>();
for (Object o : element.getChildren(PATH)) {
myGroupPath.add(((Element)o).getAttributeValue(VALUE));
}
final String attributeValue = element.getAttributeValue(VALUE);
if (element.getAttributeValue(IS_ACTION) != null) {
myComponent = attributeValue;
}
else if (element.getAttributeValue(SEPARATOR) != null) {
myComponent = Separator.getInstance();
}
else if (element.getAttributeValue(IS_GROUP) != null) {
final AnAction action = ActionManager.getInstance().getAction(attributeValue);
myComponent = action instanceof ActionGroup
? ActionsTreeUtil.createGroup((ActionGroup)action, true, null)
: new Group(attributeValue, attributeValue, null);
}
myActionType = Integer.parseInt(element.getAttributeValue(ACTION_TYPE));
myAbsolutePosition = Integer.parseInt(element.getAttributeValue(POSITION));
DefaultJDOMExternalizer.readExternal(this, element);
}
示例5: getCorrectedAction
import com.intellij.openapi.actionSystem.ActionGroup; //导入依赖的package包/类
public AnAction getCorrectedAction(String id) {
if (! myIdToNameList.contains(new Pair(id, ""))){
return ActionManager.getInstance().getAction(id);
}
if (myIdToActionGroup.get(id) == null) {
for (Pair pair : myIdToNameList) {
if (pair.first.equals(id)){
final ActionGroup actionGroup = (ActionGroup)ActionManager.getInstance().getAction(id);
if (actionGroup != null) { //J2EE/Commander plugin was disabled
myIdToActionGroup.put(id, CustomizationUtil.correctActionGroup(actionGroup, this, pair.second, pair.second));
}
}
}
}
return myIdToActionGroup.get(id);
}
示例6: isCorrectActionGroup
import com.intellij.openapi.actionSystem.ActionGroup; //导入依赖的package包/类
public boolean isCorrectActionGroup(ActionGroup group, String defaultGroupName) {
if (myActions.isEmpty()){
return false;
}
final String text = group.getTemplatePresentation().getText();
if (!StringUtil.isEmpty(text)) {
for (ActionUrl url : myActions) {
if (url.getGroupPath().contains(text) || url.getGroupPath().contains(defaultGroupName)) {
return true;
}
if (url.getComponent() instanceof Group) {
final Group urlGroup = (Group)url.getComponent();
String id = urlGroup.getName() != null ? urlGroup.getName() : urlGroup.getId();
if (id == null || id.equals(text) || id.equals(defaultGroupName)) {
return true;
}
}
}
return false;
}
return true;
}
示例7: createActions
import com.intellij.openapi.actionSystem.ActionGroup; //导入依赖的package包/类
@NotNull
private ActionGroup createActions() {
DefaultActionGroup popupGroup = new DefaultActionGroup(null, false);
AbstractRepositoryManager<Repo> repositoryManager = myRepositoryManager;
if (repositoryManager.moreThanOneRoot()) {
if (userWantsSyncControl()) {
fillWithCommonRepositoryActions(popupGroup, repositoryManager);
}
else {
fillPopupWithCurrentRepositoryActions(popupGroup, createRepositoriesActions());
}
}
else {
fillPopupWithCurrentRepositoryActions(popupGroup, null);
}
popupGroup.addSeparator();
return popupGroup;
}
示例8: getChildren
import com.intellij.openapi.actionSystem.ActionGroup; //导入依赖的package包/类
@Override
@NotNull
public AnAction[] getChildren(@Nullable AnActionEvent e) {
List<AnAction> result = new ArrayList<AnAction>();
for (AnAction action : myDelegate.getChildren(e)) {
if (myExcludes.contains(action)) {
continue;
}
if (action instanceof ActionGroup) {
result.add(new ExcludingActionGroup((ActionGroup) action, myExcludes));
} else {
result.add(action);
}
}
return result.toArray(new AnAction[result.size()]);
}
示例9: getToolbarActions
import com.intellij.openapi.actionSystem.ActionGroup; //导入依赖的package包/类
@NotNull
public ActionGroup getToolbarActions(Project project, DeviceContext deviceContext) {
DefaultActionGroup group = new DefaultActionGroup();
group.add(new ScreenshotAction(project, deviceContext));
group.add(new ScreenRecorderAction(project, deviceContext));
group.add(DumpSysActions.create(project, deviceContext));
//group.add(new MyFileExplorerAction());
group.add(new Separator());
group.add(new TerminateVMAction(deviceContext));
//group.add(new MyAllocationTrackerAction());
//group.add(new Separator());
return group;
}
示例10: createActionToolbar
import com.intellij.openapi.actionSystem.ActionGroup; //导入依赖的package包/类
@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;
}
示例11: createConsolePanel
import com.intellij.openapi.actionSystem.ActionGroup; //导入依赖的package包/类
private static JComponent createConsolePanel(ConsoleView view, ActionGroup actions) {
JPanel panel = new JPanel();
panel.setLayout(new BorderLayout());
panel.add(view.getComponent(), BorderLayout.CENTER);
panel.add(createToolbar(actions), BorderLayout.WEST);
return panel;
}
示例12: createActions
import com.intellij.openapi.actionSystem.ActionGroup; //导入依赖的package包/类
/**
* 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;
}
示例13: createToolbarFromGroupId
import com.intellij.openapi.actionSystem.ActionGroup; //导入依赖的package包/类
private static ActionToolbar createToolbarFromGroupId(final String groupId) {
final ActionManager actionManager = ActionManager.getInstance();
if (!actionManager.isGroup(groupId)) {
throw new IllegalStateException(groupId + " should have been a group");
}
final ActionGroup group = ((ActionGroup)actionManager.getAction(groupId));
final ActionToolbarImpl editorToolbar =
((ActionToolbarImpl)actionManager.createActionToolbar(ActionPlaces.EDITOR_TOOLBAR, group, true));
editorToolbar.setOpaque(false);
editorToolbar.setBorder(new JBEmptyBorder(0, 2, 0, 2));
return editorToolbar;
}
示例14: createActionToolbar
import com.intellij.openapi.actionSystem.ActionGroup; //导入依赖的package包/类
@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;
}
示例15: createTrees
import com.intellij.openapi.actionSystem.ActionGroup; //导入依赖的package包/类
protected void createTrees(@NotNull Map<String, JTree> trees) {
final JTree tree = createTree(false);
ActionGroup group = (ActionGroup)ActionManager.getInstance().getAction(IdeActions.GROUP_METHOD_HIERARCHY_POPUP);
PopupHandler.installPopupHandler(tree, group, ActionPlaces.METHOD_HIERARCHY_VIEW_POPUP, ActionManager.getInstance());
final BaseOnThisMethodAction baseOnThisMethodAction = new BaseOnThisMethodAction();
baseOnThisMethodAction
.registerCustomShortcutSet(ActionManager.getInstance().getAction(IdeActions.ACTION_METHOD_HIERARCHY).getShortcutSet(), tree);
trees.put(METHOD_TYPE, tree);
}