Search in sources :

Example 31 with ActionGroup

use of com.intellij.openapi.actionSystem.ActionGroup in project azure-tools-for-java by Microsoft.

the class AzureActionsComponent method initComponent.

public void initComponent() {
    if (!AzurePlugin.IS_ANDROID_STUDIO) {
        initAuthManage();
        ActionManager am = ActionManager.getInstance();
        DefaultActionGroup toolbarGroup = (DefaultActionGroup) am.getAction(IdeActions.GROUP_MAIN_TOOLBAR);
        toolbarGroup.addAll((DefaultActionGroup) am.getAction("AzureToolbarGroup"));
        DefaultActionGroup popupGroup = (DefaultActionGroup) am.getAction(IdeActions.GROUP_PROJECT_VIEW_POPUP);
        popupGroup.add(am.getAction("AzurePopupGroup"));
        if (PlatformUtils.isIdeaUltimate()) {
            ActionManager actionManager = ActionManager.getInstance();
            DefaultActionGroup actionGroup = (DefaultActionGroup) actionManager.getAction("PublishGroup");
            if (actionGroup != null)
                actionGroup.addAll((ActionGroup) actionManager.getAction("AzureWebDeployGroup"));
        }
    }
    try {
        PlatformDependent.isAndroid();
    } catch (Throwable ignored) {
        DefaultLoader.getUIHelper().showError("A problem with your Android Support plugin setup is preventing the Azure Toolkit from functioning correctly (Retrofit2 and RxJava failed to initialize).\n" + "To fix this issue, try disabling the Android Support plugin or installing the Android SDK", "Azure Toolkit for IntelliJ");
    //            DefaultLoader.getUIHelper().showException("Android Support Error: isAndroid() throws " + ignored.getMessage(), ignored, "Error Android", true, false);
    }
}
Also used : ActionManager(com.intellij.openapi.actionSystem.ActionManager) ActionGroup(com.intellij.openapi.actionSystem.ActionGroup) DefaultActionGroup(com.intellij.openapi.actionSystem.DefaultActionGroup) DefaultActionGroup(com.intellij.openapi.actionSystem.DefaultActionGroup)

Example 32 with ActionGroup

use of com.intellij.openapi.actionSystem.ActionGroup in project intellij-plugins by JetBrains.

the class SplitEditorToolbar method createToolbarFromGroupId.

@NotNull
private static ActionToolbar createToolbarFromGroupId(@NotNull String groupId) {
    final ActionManager actionManager = ActionManager.getInstance();
    if (!actionManager.isGroup(groupId)) {
        throw new IllegalStateException(groupId + " should have been a group");
    }
    final ActionGroup group = ((ActionGroup) actionManager.getAction(groupId));
    final ActionToolbarImpl editorToolbar = ((ActionToolbarImpl) actionManager.createActionToolbar(ActionPlaces.EDITOR_TOOLBAR, group, true));
    editorToolbar.setOpaque(false);
    editorToolbar.setBorder(new JBEmptyBorder(0, 2, 0, 2));
    return editorToolbar;
}
Also used : ActionManager(com.intellij.openapi.actionSystem.ActionManager) JBEmptyBorder(com.intellij.util.ui.JBEmptyBorder) ActionGroup(com.intellij.openapi.actionSystem.ActionGroup) ActionToolbarImpl(com.intellij.openapi.actionSystem.impl.ActionToolbarImpl) NotNull(org.jetbrains.annotations.NotNull)

Aggregations

ActionGroup (com.intellij.openapi.actionSystem.ActionGroup)32 DefaultActionGroup (com.intellij.openapi.actionSystem.DefaultActionGroup)9 AnAction (com.intellij.openapi.actionSystem.AnAction)8 NotNull (org.jetbrains.annotations.NotNull)6 ActionManager (com.intellij.openapi.actionSystem.ActionManager)4 ActionToolbar (com.intellij.openapi.actionSystem.ActionToolbar)4 GutterIconRenderer (com.intellij.openapi.editor.markup.GutterIconRenderer)3 List (java.util.List)3 Nullable (org.jetbrains.annotations.Nullable)3 Pass (com.intellij.codeHighlighting.Pass)2 LineMarkerInfo (com.intellij.codeInsight.daemon.LineMarkerInfo)2 BranchActionGroup (com.intellij.dvcs.ui.BranchActionGroup)2 BranchActionGroupPopup.wrapWithMoreActionIfNeeded (com.intellij.dvcs.ui.BranchActionGroupPopup.wrapWithMoreActionIfNeeded)2 FAVORITE_BRANCH_COMPARATOR (com.intellij.dvcs.ui.BranchActionUtil.FAVORITE_BRANCH_COMPARATOR)2 BranchActionUtil.getNumOfTopShownBranches (com.intellij.dvcs.ui.BranchActionUtil.getNumOfTopShownBranches)2 AllIcons (com.intellij.icons.AllIcons)2 Group (com.intellij.openapi.keymap.impl.ui.Group)2 Project (com.intellij.openapi.project.Project)2 PsiElement (com.intellij.psi.PsiElement)2 SimpleActionGroup (com.intellij.tools.SimpleActionGroup)2