summaryrefslogtreecommitdiff
path: root/platform/platform-api/src/com/intellij/openapi/actionSystem
diff options
context:
space:
mode:
Diffstat (limited to 'platform/platform-api/src/com/intellij/openapi/actionSystem')
-rw-r--r--platform/platform-api/src/com/intellij/openapi/actionSystem/ActionPlaces.java3
-rw-r--r--platform/platform-api/src/com/intellij/openapi/actionSystem/ActionStub.java7
-rw-r--r--platform/platform-api/src/com/intellij/openapi/actionSystem/CommonShortcuts.java12
3 files changed, 17 insertions, 5 deletions
diff --git a/platform/platform-api/src/com/intellij/openapi/actionSystem/ActionPlaces.java b/platform/platform-api/src/com/intellij/openapi/actionSystem/ActionPlaces.java
index e3248b863aba..16a81d2218d2 100644
--- a/platform/platform-api/src/com/intellij/openapi/actionSystem/ActionPlaces.java
+++ b/platform/platform-api/src/com/intellij/openapi/actionSystem/ActionPlaces.java
@@ -76,6 +76,7 @@ public abstract class ActionPlaces {
public static final String ANT_MESSAGES_TOOLBAR = "AntMessagesToolbar";
public static final String ANT_EXPLORER_POPUP = "AntExplorerPopup";
public static final String ANT_EXPLORER_TOOLBAR = "AntExplorerToolbar";
+ public static final String GULP_VIEW_POPUP = "JavaScriptGulpPopup";
//todo: probably these context should be splitted into several contexts
public static final String CODE_INSPECTION = "CodeInspection";
@@ -133,7 +134,7 @@ public abstract class ActionPlaces {
FILEVIEW_POPUP, CHECKOUT_POPUP, LVCS_DIRECTORY_HISTORY_POPUP, GUI_DESIGNER_EDITOR_POPUP, GUI_DESIGNER_COMPONENT_TREE_POPUP,
GUI_DESIGNER_PROPERTY_INSPECTOR_POPUP,
CREATE_EJB_POPUP, CHANGES_VIEW_POPUP, REMOTE_HOST_VIEW_POPUP, REMOTE_HOST_DIALOG_POPUP, TFS_TREE_POPUP,
- ACTION_PLACE_VCS_QUICK_LIST_POPUP_ACTION, PHING_EXPLORER_POPUP, NAVIGATION_BAR_POPUP
+ ACTION_PLACE_VCS_QUICK_LIST_POPUP_ACTION, PHING_EXPLORER_POPUP, NAVIGATION_BAR_POPUP, GULP_VIEW_POPUP
};
public static boolean isPopupPlace(@NotNull String place) {
diff --git a/platform/platform-api/src/com/intellij/openapi/actionSystem/ActionStub.java b/platform/platform-api/src/com/intellij/openapi/actionSystem/ActionStub.java
index 09896aaf0da8..c96ce2aa3371 100644
--- a/platform/platform-api/src/com/intellij/openapi/actionSystem/ActionStub.java
+++ b/platform/platform-api/src/com/intellij/openapi/actionSystem/ActionStub.java
@@ -29,6 +29,7 @@ public class ActionStub extends AnAction{
private static final Logger LOG=Logger.getInstance("#com.intellij.openapi.actionSystem.ActionStub");
private final String myClassName;
+ private final String myProjectType;
private final String myId;
private final String myText;
private final ClassLoader myLoader;
@@ -40,9 +41,10 @@ public class ActionStub extends AnAction{
@NotNull String text,
ClassLoader loader,
PluginId pluginId,
- String iconPath) {
+ String iconPath, String projectType) {
myLoader = loader;
myClassName=actionClass;
+ myProjectType = projectType;
LOG.assertTrue(!id.isEmpty());
myId=id;
myText=text;
@@ -102,4 +104,7 @@ public class ActionStub extends AnAction{
targetAction.setShortcutSet(getShortcutSet());
}
+ public String getProjectType() {
+ return myProjectType;
+ }
}
diff --git a/platform/platform-api/src/com/intellij/openapi/actionSystem/CommonShortcuts.java b/platform/platform-api/src/com/intellij/openapi/actionSystem/CommonShortcuts.java
index 994dd130c384..a1441565d90b 100644
--- a/platform/platform-api/src/com/intellij/openapi/actionSystem/CommonShortcuts.java
+++ b/platform/platform-api/src/com/intellij/openapi/actionSystem/CommonShortcuts.java
@@ -15,9 +15,11 @@
*/
package com.intellij.openapi.actionSystem;
+import com.intellij.openapi.application.Application;
import com.intellij.openapi.application.ApplicationManager;
import com.intellij.openapi.keymap.KeymapManager;
import com.intellij.openapi.util.SystemInfo;
+import org.jetbrains.annotations.NotNull;
import javax.swing.*;
import java.awt.event.InputEvent;
@@ -148,9 +150,13 @@ public class CommonShortcuts {
return shortcutsById(IdeActions.ACTION_DELETE);
}
+ @NotNull
private static CustomShortcutSet shortcutsById(String actionId) {
- if (ApplicationManager.getApplication() == null) return new CustomShortcutSet(Shortcut.EMPTY_ARRAY);
-
- return new CustomShortcutSet(KeymapManager.getInstance().getActiveKeymap().getShortcuts(actionId));
+ Application application = ApplicationManager.getApplication();
+ KeymapManager keymapManager = application == null ? null : application.getComponent(KeymapManager.class);
+ if (keymapManager == null) {
+ return new CustomShortcutSet(Shortcut.EMPTY_ARRAY);
+ }
+ return new CustomShortcutSet(keymapManager.getActiveKeymap().getShortcuts(actionId));
}
}