當前位置: 首頁>>代碼示例>>Java>>正文


Java DefaultActionGroup.addAction方法代碼示例

本文整理匯總了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);
}
 
開發者ID:JFrogDev,項目名稱:jfrog-idea-plugin,代碼行數:8,代碼來源:ComponentUtils.java

示例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);

}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:10,代碼來源:GitSkippedCommits.java

示例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;
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:29,代碼來源:GitBranchPopupActions.java

示例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;
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:32,代碼來源:HgBranchPopupActions.java


注:本文中的com.intellij.openapi.actionSystem.DefaultActionGroup.addAction方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。