本文整理匯總了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;
}