Search in sources :

Example 96 with DefaultActionGroup

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;
}
Also used : DefaultActionGroup(com.intellij.openapi.actionSystem.DefaultActionGroup) AnAction(com.intellij.openapi.actionSystem.AnAction)

Example 97 with DefaultActionGroup

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;
}
Also used : HgRepository(org.zmlx.hg4idea.repo.HgRepository) DefaultActionGroup(com.intellij.openapi.actionSystem.DefaultActionGroup) NotNull(org.jetbrains.annotations.NotNull)

Example 98 with DefaultActionGroup

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);
}
Also used : MetaModel(com.intellij.designer.model.MetaModel) RadComponent(com.intellij.designer.model.RadComponent) DefaultActionGroup(com.intellij.openapi.actionSystem.DefaultActionGroup)

Example 99 with DefaultActionGroup

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;
}
Also used : DefaultActionGroup(com.intellij.openapi.actionSystem.DefaultActionGroup)

Example 100 with DefaultActionGroup

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;
}
Also used : DefaultActionGroup(com.intellij.openapi.actionSystem.DefaultActionGroup)

Aggregations

DefaultActionGroup (com.intellij.openapi.actionSystem.DefaultActionGroup)109 NotNull (org.jetbrains.annotations.NotNull)38 AnAction (com.intellij.openapi.actionSystem.AnAction)22 AnActionEvent (com.intellij.openapi.actionSystem.AnActionEvent)16 Nullable (org.jetbrains.annotations.Nullable)11 ActionManager (com.intellij.openapi.actionSystem.ActionManager)8 ActionGroup (com.intellij.openapi.actionSystem.ActionGroup)7 Separator (com.intellij.openapi.actionSystem.Separator)7 ListPopup (com.intellij.openapi.ui.popup.ListPopup)7 Content (com.intellij.ui.content.Content)6 BrowserHelpAction (com.android.tools.idea.actions.BrowserHelpAction)5 Project (com.intellij.openapi.project.Project)5 VirtualFile (com.intellij.openapi.vfs.VirtualFile)5 List (java.util.List)5 RecordingAction (com.android.tools.idea.monitor.actions.RecordingAction)4 ActionToolbar (com.intellij.openapi.actionSystem.ActionToolbar)4 DumbAwareAction (com.intellij.openapi.project.DumbAwareAction)4 javax.swing (javax.swing)4 FolderConfiguration (com.android.ide.common.resources.configuration.FolderConfiguration)3 CommonActionsManager (com.intellij.ide.CommonActionsManager)3