diff --git a/java/debugger/impl/src/com/intellij/debugger/actions/RunToCursorActionHandler.java b/java/debugger/impl/src/com/intellij/debugger/actions/RunToCursorActionHandler.java index 752a4744c6bf..6bef7bcb9705 100644 --- a/java/debugger/impl/src/com/intellij/debugger/actions/RunToCursorActionHandler.java +++ b/java/debugger/impl/src/com/intellij/debugger/actions/RunToCursorActionHandler.java @@ -28,9 +28,7 @@ import com.intellij.debugger.impl.DebuggerSession; import com.intellij.openapi.actionSystem.AnActionEvent; import com.intellij.openapi.actionSystem.CommonDataKeys; import com.intellij.openapi.editor.Editor; -import com.intellij.openapi.fileTypes.FileType; import com.intellij.openapi.project.Project; -import com.intellij.openapi.vfs.VirtualFile; import com.intellij.psi.PsiDocumentManager; import com.intellij.psi.PsiFile; import com.intellij.xdebugger.impl.actions.DebuggerActionHandler; @@ -49,9 +47,7 @@ public class RunToCursorActionHandler extends DebuggerActionHandler { @Override public boolean isEnabled(final @NotNull Project project, final AnActionEvent event) { - Editor editor = event.getData(CommonDataKeys.EDITOR); - if (editor == null) { return false; } @@ -61,9 +57,7 @@ public class RunToCursorActionHandler extends DebuggerActionHandler { return false; } - final VirtualFile virtualFile = file.getVirtualFile(); - FileType fileType = virtualFile != null ? virtualFile.getFileType() : null; - if (DebuggerUtils.supportsJVMDebugging(fileType) || DebuggerUtils.supportsJVMDebugging(file)) { + if (DebuggerUtils.isDebugActionAware(file)) { DebuggerSession debuggerSession = DebuggerManagerEx.getInstanceEx(project).getContext().getDebuggerSession(); return debuggerSession != null && debuggerSession.isPaused(); } diff --git a/java/debugger/impl/src/com/intellij/debugger/actions/ToggleBreakpointEnabledAction.java b/java/debugger/impl/src/com/intellij/debugger/actions/ToggleBreakpointEnabledAction.java index 693b7f4917a5..a57211b60ead 100644 --- a/java/debugger/impl/src/com/intellij/debugger/actions/ToggleBreakpointEnabledAction.java +++ b/java/debugger/impl/src/com/intellij/debugger/actions/ToggleBreakpointEnabledAction.java @@ -25,10 +25,7 @@ import com.intellij.openapi.actionSystem.CommonDataKeys; import com.intellij.openapi.actionSystem.Presentation; import com.intellij.openapi.editor.Editor; import com.intellij.openapi.fileEditor.FileEditorManager; -import com.intellij.openapi.fileTypes.FileType; -import com.intellij.openapi.fileTypes.FileTypeManager; import com.intellij.openapi.project.Project; -import com.intellij.openapi.vfs.VirtualFile; import com.intellij.psi.PsiDocumentManager; import com.intellij.psi.PsiFile; import org.jetbrains.annotations.Nullable; @@ -74,10 +71,7 @@ public class ToggleBreakpointEnabledAction extends AnAction { return; } - FileTypeManager fileTypeManager = FileTypeManager.getInstance(); - final VirtualFile virtualFile = file.getVirtualFile(); - FileType fileType = virtualFile != null ? virtualFile.getFileType() : null; - if (DebuggerUtils.supportsJVMDebugging(fileType) || DebuggerUtils.supportsJVMDebugging(file)) { + if (DebuggerUtils.isBreakpointAware(file)) { Breakpoint breakpoint = findBreakpoint(project); if (breakpoint == null) { presentation.setEnabled(false); diff --git a/java/debugger/impl/src/com/intellij/debugger/ui/breakpoints/JavaLineBreakpointTypeBase.java b/java/debugger/impl/src/com/intellij/debugger/ui/breakpoints/JavaLineBreakpointTypeBase.java index 08b26bb7280e..e6f3cf3f017e 100644 --- a/java/debugger/impl/src/com/intellij/debugger/ui/breakpoints/JavaLineBreakpointTypeBase.java +++ b/java/debugger/impl/src/com/intellij/debugger/ui/breakpoints/JavaLineBreakpointTypeBase.java @@ -20,7 +20,6 @@ import com.intellij.debugger.engine.DebuggerUtils; import com.intellij.debugger.ui.JavaDebuggerSupport; import com.intellij.openapi.editor.Document; import com.intellij.openapi.fileEditor.FileDocumentManager; -import com.intellij.openapi.fileTypes.FileType; import com.intellij.openapi.fileTypes.StdFileTypes; import com.intellij.openapi.project.Project; import com.intellij.openapi.util.Ref; @@ -88,15 +87,11 @@ public abstract class JavaLineBreakpointTypeBase
EP_NAME = ExtensionPointName.create("com.intellij.debugger.jvmDebugProvider");
diff --git a/java/debugger/openapi/src/com/intellij/debugger/engine/JavaDebugAware.java b/java/debugger/openapi/src/com/intellij/debugger/engine/JavaDebugAware.java
new file mode 100644
index 000000000000..c62cf0101555
--- /dev/null
+++ b/java/debugger/openapi/src/com/intellij/debugger/engine/JavaDebugAware.java
@@ -0,0 +1,32 @@
+/*
+ * Copyright 2000-2014 JetBrains s.r.o.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.intellij.debugger.engine;
+
+import com.intellij.openapi.extensions.ExtensionPointName;
+import com.intellij.openapi.fileTypes.FileType;
+import com.intellij.psi.PsiFile;
+import org.jetbrains.annotations.NotNull;
+
+public abstract class JavaDebugAware {
+ static final ExtensionPointName