Search in sources :

Example 1 with XLineBreakpointType

use of com.intellij.xdebugger.breakpoints.XLineBreakpointType in project intellij-community by JetBrains.

the class XToggleLineBreakpointActionHandler method isEnabled.

@Override
public boolean isEnabled(@NotNull final Project project, final AnActionEvent event) {
    XLineBreakpointType<?>[] breakpointTypes = XDebuggerUtil.getInstance().getLineBreakpointTypes();
    final XBreakpointManager breakpointManager = XDebuggerManager.getInstance(project).getBreakpointManager();
    for (XSourcePosition position : XDebuggerUtilImpl.getAllCaretsPositions(project, event.getDataContext())) {
        for (XLineBreakpointType<?> breakpointType : breakpointTypes) {
            final VirtualFile file = position.getFile();
            final int line = position.getLine();
            if (breakpointType.canPutAt(file, line, project) || breakpointManager.findBreakpointAtLine(breakpointType, file, line) != null) {
                return true;
            }
        }
    }
    return false;
}
Also used : VirtualFile(com.intellij.openapi.vfs.VirtualFile) XBreakpointManager(com.intellij.xdebugger.breakpoints.XBreakpointManager) XLineBreakpointType(com.intellij.xdebugger.breakpoints.XLineBreakpointType) XSourcePosition(com.intellij.xdebugger.XSourcePosition)

Aggregations

VirtualFile (com.intellij.openapi.vfs.VirtualFile)1 XSourcePosition (com.intellij.xdebugger.XSourcePosition)1 XBreakpointManager (com.intellij.xdebugger.breakpoints.XBreakpointManager)1 XLineBreakpointType (com.intellij.xdebugger.breakpoints.XLineBreakpointType)1