本文整理汇总了Java中com.intellij.openapi.actionSystem.DefaultActionGroup.addAction方法的典型用法代码示例。如果您正苦于以下问题:Java DefaultActionGroup.addAction方法的具体用法?Java DefaultActionGroup.addAction怎么用?Java DefaultActionGroup.addAction使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.openapi.actionSystem.DefaultActionGroup
的用法示例。
在下文中一共展示了DefaultActionGroup.addAction方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createActionToolbar
import com.intellij.openapi.actionSystem.DefaultActionGroup; //导入方法依赖的package包/类
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);
}
示例2: addActionsTo
import com.intellij.openapi.actionSystem.DefaultActionGroup; //导入方法依赖的package包/类
@Override
protected void addActionsTo(DefaultActionGroup group) {
super.addActionsTo(group);
ShowAllAffectedGenericAction showCommit = ShowAllAffectedGenericAction.getInstance();
showCommit.registerCustomShortcutSet(new CustomShortcutSet(
CommonShortcuts.DOUBLE_CLICK_1.getShortcuts()[0]), myTree);
group.addAction(showCommit);
}
示例3: createActions
import com.intellij.openapi.actionSystem.DefaultActionGroup; //导入方法依赖的package包/类
ActionGroup createActions(@Nullable DefaultActionGroup toInsert) {
DefaultActionGroup popupGroup = new DefaultActionGroup(null, false);
popupGroup.addAction(new GitNewBranchAction(myProject,Collections.singletonList(myRepository)));
popupGroup.addAction(new CheckoutRevisionActions(myProject, myRepository));
if (toInsert != null) {
popupGroup.addAll(toInsert);
}
popupGroup.addSeparator("Local Branches");
List<GitBranch> localBranches = new ArrayList<GitBranch>(myRepository.getBranches().getLocalBranches());
Collections.sort(localBranches);
for (GitBranch localBranch : localBranches) {
if (!localBranch.equals(myRepository.getCurrentBranch())) { // don't show current branch in the list
popupGroup.add(new LocalBranchActions(myProject, Collections.singletonList(myRepository), localBranch.getName(), myRepository));
}
}
popupGroup.addSeparator("Remote Branches");
List<GitBranch> remoteBranches = new ArrayList<GitBranch>(myRepository.getBranches().getRemoteBranches());
Collections.sort(remoteBranches);
for (GitBranch remoteBranch : remoteBranches) {
popupGroup.add(new RemoteBranchActions(myProject, Collections.singletonList(myRepository), remoteBranch.getName(), myRepository));
}
return popupGroup;
}
示例4: createActions
import com.intellij.openapi.actionSystem.DefaultActionGroup; //导入方法依赖的package包/类
ActionGroup createActions(@Nullable DefaultActionGroup toInsert) {
DefaultActionGroup popupGroup = new DefaultActionGroup(null, false);
popupGroup.addAction(new HgNewBranchAction(myProject, Collections.singletonList(myRepository), myRepository));
popupGroup.addAction(new HgNewBookmarkAction(Collections.singletonList(myRepository), myRepository));
popupGroup.addAction(new HgBranchPopupActions.HgCloseBranchAction(Collections.singletonList(myRepository), myRepository));
popupGroup.addAction(new HgShowUnnamedHeadsForCurrentBranchAction(myRepository));
if (toInsert != null) {
popupGroup.addAll(toInsert);
}
popupGroup.addSeparator("Bookmarks");
List<String> bookmarkNames = getSortedNamesWithoutHashes(myRepository.getBookmarks());
String currentBookmark = myRepository.getCurrentBookmark();
for (String bookmark : bookmarkNames) {
AnAction bookmarkAction = new BookmarkActions(myProject, Collections.singletonList(myRepository), bookmark);
if (bookmark.equals(currentBookmark)) {
bookmarkAction.getTemplatePresentation().setIcon(PlatformIcons.CHECK_ICON);
}
popupGroup.add(bookmarkAction);
}
popupGroup.addSeparator("Branches");
List<String> branchNamesList = new ArrayList<String>(myRepository.getOpenedBranches());//only opened branches have to be shown
Collections.sort(branchNamesList);
for (String branch : branchNamesList) {
if (!branch.equals(myRepository.getCurrentBranch())) { // don't show current branch in the list
popupGroup.add(new HgCommonBranchActions(myProject, Collections.singletonList(myRepository), branch));
}
}
return popupGroup;
}