use of com.intellij.openapi.actionSystem.DefaultActionGroup in project intellij-community by JetBrains.
the class HgBranchPopupActions method createActions.
ActionGroup createActions(@Nullable DefaultActionGroup toInsert, @NotNull String repoInfo) {
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" + repoInfo);
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" + repoInfo);
//only opened branches have to be shown
List<String> branchNamesList = new ArrayList<>(myRepository.getOpenedBranches());
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;
}
use of com.intellij.openapi.actionSystem.DefaultActionGroup in project intellij-community by JetBrains.
the class HgBranchPopup method createRepositoriesActions.
@NotNull
protected DefaultActionGroup createRepositoriesActions() {
DefaultActionGroup popupGroup = new DefaultActionGroup(null, false);
popupGroup.addSeparator("Repositories");
for (HgRepository repository : DvcsUtil.sortRepositories(myRepositoryManager.getRepositories())) {
popupGroup.add(new RootAction<>(repository, highlightCurrentRepo() ? myCurrentRepository : null, new HgBranchPopupActions(repository.getProject(), repository).createActions(), HgUtil.getDisplayableBranchOrBookmarkText(repository)));
}
return popupGroup;
}
use of com.intellij.openapi.actionSystem.DefaultActionGroup in project intellij-community by JetBrains.
the class MorphingAction method fill.
public static void fill(DesignerEditorPanel designer, DefaultActionGroup group, EditableArea area) {
List<RadComponent> selection = area.getSelection();
if (selection.isEmpty()) {
return;
}
MetaModel model = null;
for (RadComponent component : selection) {
if (model == null) {
model = component.getMetaModel();
} else if (model != component.getMetaModel()) {
return;
}
}
if (model == null) {
return;
}
List<MetaModel> models = model.getMorphingModels();
if (models.isEmpty()) {
return;
}
DefaultActionGroup morphingGroup = new DefaultActionGroup("Morphing", true);
for (MetaModel morphingModel : models) {
morphingGroup.add(new MorphingAction(designer, area, selection, morphingModel));
}
group.add(morphingGroup);
}
use of com.intellij.openapi.actionSystem.DefaultActionGroup in project intellij-community by JetBrains.
the class RadFormLayoutManager method getCaptionActions.
@Override
public ActionGroup getCaptionActions() {
DefaultActionGroup group = new DefaultActionGroup();
group.add(new InsertBeforeAction());
group.add(new InsertAfterAction());
group.add(new SplitAction());
group.add(new DeleteAction());
group.add(new GroupRowsColumnsAction());
group.add(new UngroupRowsColumnsAction());
return group;
}
use of com.intellij.openapi.actionSystem.DefaultActionGroup in project intellij-community by JetBrains.
the class BranchFilterPopupComponent method createActionGroup.
@Override
protected ActionGroup createActionGroup() {
DefaultActionGroup actionGroup = new DefaultActionGroup();
actionGroup.add(createAllAction());
actionGroup.add(createSelectMultipleValuesAction());
actionGroup.add(new MyBranchPopupBuilder(myFilterModel.getDataPack(), myBranchFilterModel.getVisibleRoots(), getRecentValuesFromSettings()).build());
return actionGroup;
}
Aggregations