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 EP_NAME = ExtensionPointName.create("com.intellij.debugger.javaDebugAware"); + + public abstract boolean isBreakpointAware(@NotNull PsiFile psiFile, @NotNull FileType fileType); + + // IDEA-122113, will be removed when Java debugger will be moved to XDebugger API + public boolean isActionAware(@NotNull PsiFile psiFile, @NotNull FileType fileType) { + return isBreakpointAware(psiFile, fileType); + } +} \ No newline at end of file diff --git a/platform/core-api/src/com/intellij/openapi/fileTypes/LanguageFileType.java b/platform/core-api/src/com/intellij/openapi/fileTypes/LanguageFileType.java index 6385e73f209e..9fc9f112053a 100644 --- a/platform/core-api/src/com/intellij/openapi/fileTypes/LanguageFileType.java +++ b/platform/core-api/src/com/intellij/openapi/fileTypes/LanguageFileType.java @@ -63,7 +63,7 @@ public abstract class LanguageFileType implements FileType{ } /** - * @deprecated implement own {@link com.intellij.debugger.engine.JVMDebugProvider} instead + * @deprecated implement own {@link com.intellij.debugger.engine.JavaDebugAware} instead */ @Deprecated public boolean isJVMDebuggingSupported() { diff --git a/resources/src/META-INF/IdeaPlugin.xml b/resources/src/META-INF/IdeaPlugin.xml index ff39c265a942..46e0ad6cac47 100644 --- a/resources/src/META-INF/IdeaPlugin.xml +++ b/resources/src/META-INF/IdeaPlugin.xml @@ -88,6 +88,8 @@ +