Examples of IBreakpointManager


Examples of org.eclipse.debug.core.IBreakpointManager

    private void addBreakpointsFor(IContainer container) {
        try {
            IMarker[] markers = container.findMarkers(PyBreakpoint.PY_BREAK_MARKER, true, IResource.DEPTH_INFINITE);
            IMarker[] condMarkers = container.findMarkers(PyBreakpoint.PY_CONDITIONAL_BREAK_MARKER, true,
                    IResource.DEPTH_INFINITE);
            IBreakpointManager breakpointManager = DebugPlugin.getDefault().getBreakpointManager();

            for (IMarker marker : markers) {
                PyBreakpoint brk = (PyBreakpoint) breakpointManager.getBreakpoint(marker);
                breakpointAdded(brk);
            }

            for (IMarker marker : condMarkers) {
                PyBreakpoint brk = (PyBreakpoint) breakpointManager.getBreakpoint(marker);
                breakpointAdded(brk);
            }
        } catch (Throwable t) {
            PydevDebugPlugin.errorDialog("Error setting breakpoints", t);
        }
View Full Code Here

Examples of org.eclipse.debug.core.IBreakpointManager

        this.debugger = debugger;
        this.threads = new PyThread[0];
        this.project = project;
        launch.addDebugTarget(this);
        debugger.addTarget(this);
        IBreakpointManager breakpointManager = DebugPlugin.getDefault().getBreakpointManager();
        breakpointManager.addBreakpointListener(this);
        PyExceptionBreakPointManager.getInstance().addListener(this);
        PyPropertyTraceManager.getInstance().addListener(this);
        // we have to know when we get removed, so that we can shut off the debugger
        DebugPlugin.getDefault().getLaunchManager().addLaunchListener(this);
    }
View Full Code Here

Examples of org.eclipse.debug.core.IBreakpointManager

    }

    public void launchRemoved(ILaunch launch) {
        // shut down the remote debugger when parent launch
        if (launch == this.launch) {
            IBreakpointManager breakpointManager = DebugPlugin.getDefault().getBreakpointManager();
            breakpointManager.removeBreakpointListener(this);
            PyExceptionBreakPointManager.getInstance().removeListener(this);
            PyPropertyTraceManager.getInstance().removeListener(this);
            debugger.dispose();
            debugger = null;
        }
View Full Code Here

Examples of org.eclipse.debug.core.IBreakpointManager

        }

        public void onDispose(PyEdit edit, IProgressMonitor monitor) {
            if (this.edit != null) {
                this.edit = null;
                IBreakpointManager breakpointManager = DebugPlugin.getDefault().getBreakpointManager();
                breakpointManager.removeBreakpointListener(this);
            }
        }
View Full Code Here

Examples of org.eclipse.debug.core.IBreakpointManager

         * will update the debug annotations.
         */
        public void onSetDocument(IDocument document, PyEdit edit, IProgressMonitor monitor) {
            if (this.edit != null) {
                this.edit = null;
                IBreakpointManager breakpointManager = DebugPlugin.getDefault().getBreakpointManager();
                breakpointManager.removeBreakpointListener(this);
            }

            if (AbstractBreakpointRulerAction.isExternalFileEditor(edit)) {
                this.edit = edit;
                IBreakpointManager breakpointManager = DebugPlugin.getDefault().getBreakpointManager();
                breakpointManager.addBreakpointListener(this);
            }

            //initial update (the others will be on changes)
            updateAnnotations();
        }
View Full Code Here

Examples of org.eclipse.debug.core.IBreakpointManager

            if (!(resource instanceof IFile)) {
                //it was created from an external file
                isExternalFile = true;
            }

            IBreakpointManager breakpointManager = DebugPlugin.getDefault().getBreakpointManager();
            for (IMarker marker : markers) {
                if (marker == null) {
                    continue;
                }
                IBreakpoint breakpoint = breakpointManager.getBreakpoint(marker);
                if (breakpoint != null && breakpointManager.isRegistered(breakpoint)) {
                    Position pos = getMarkerPosition(document, marker, annotationModel);

                    if (!isExternalFile) {
                        if (!onlyIncludeLastLineActivity) {
                            breakpoints.add(new Tuple(marker, breakpoint));
View Full Code Here

Examples of org.eclipse.debug.core.IBreakpointManager

                public void run(IProgressMonitor monitor) throws CoreException {
                    IMarker marker = resource.createMarker(PyBreakpoint.PY_BREAK_MARKER);
                    marker.setAttributes(map);
                    PyBreakpoint br = new PyBreakpoint();
                    br.setMarker(marker);
                    IBreakpointManager breakpointManager = DebugPlugin.getDefault().getBreakpointManager();
                    breakpointManager.addBreakpoint(br);
                }
            };

            resource.getWorkspace().run(runnable, null);
        } catch (Exception e) {
View Full Code Here

Examples of org.eclipse.debug.core.IBreakpointManager

    /**
     * @param markers the markers that will be removed in this function (they may be in any editor, not only in the current one)
     */
    public static void removeMarkers(List<IMarker> markers) {
        IBreakpointManager breakpointManager = DebugPlugin.getDefault().getBreakpointManager();
        try {
            Iterator<IMarker> e = markers.iterator();
            while (e.hasNext()) {
                IBreakpoint breakpoint = breakpointManager.getBreakpoint(e.next());
                breakpointManager.removeBreakpoint(breakpoint, true);
            }
        } catch (CoreException e) {
            PydevDebugPlugin.log(IStatus.ERROR, "error removing markers", e);
        }
    }
View Full Code Here

Examples of org.eclipse.debug.core.IBreakpointManager

    if (fileName != null){
      fileName = ProjectUtils.getFilePath(projectName, fileName);
    }
    Integer lineNum = commandLine.getIntValue(Options.LINE_OPTION);

    IBreakpointManager breakpointMgr = DebugPlugin.getDefault()
      .getBreakpointManager();

    IBreakpoint[] breakpoints = breakpointMgr.getBreakpoints();
    for (IBreakpoint breakpoint : breakpoints) {
      IResource resource = breakpoint.getMarker().getResource();
      String curProject = resource.getProject().getName();
      String curFileName = resource.getRawLocation().toOSString();
      if (!curProject.equals(projectName)){
        continue;
      }

      String projectRelPath = breakpoint.getMarker().getResource()
        .getProjectRelativePath().toString();
      if (fileName != null){
        if (fileName.equals(curFileName) || fileName.equals(projectRelPath)) {
          if (lineNum == null ||
              lineNum == -1 ||
              lineNum == ((ILineBreakpoint)breakpoint).getLineNumber())
          {
            breakpointMgr.removeBreakpoint(breakpoint, true);
          }
        }
      }else{
        breakpointMgr.removeBreakpoint(breakpoint, true);
      }
    }

    return Services.getMessage("debugging.breakpoint.removed");
  }
View Full Code Here

Examples of org.eclipse.debug.core.IBreakpointManager

    Integer lineNum = commandLine.getIntValue(Options.LINE_OPTION);

    ArrayList<IBreakpoint> enabled = new ArrayList<IBreakpoint>();
    ArrayList<IBreakpoint> disabled = new ArrayList<IBreakpoint>();

    IBreakpointManager breakpointMgr = DebugPlugin.getDefault()
      .getBreakpointManager();
    IBreakpoint[] breakpoints = breakpointMgr.getBreakpoints();
    for (IBreakpoint breakpoint : breakpoints) {
      IResource resource = breakpoint.getMarker().getResource();
      String curProject = resource.getProject().getName();
      String curFileName = resource.getRawLocation().toOSString();
      if (!curProject.equals(projectName)){
        continue;
      }

      String projectRelPath = breakpoint.getMarker().getResource()
        .getProjectRelativePath().toString();
      if (fileName != null){
        if (fileName.equals(curFileName) || fileName.equals(projectRelPath)) {
          if (lineNum == null ||
              lineNum == -1 ||
              lineNum == ((ILineBreakpoint)breakpoint).getLineNumber())
          {
            if (breakpoint.isEnabled()){
              enabled.add(breakpoint);
            }else{
              disabled.add(breakpoint);
            }
          }
        }
      }else{
        if (breakpoint.isEnabled()){
          enabled.add(breakpoint);
        }else{
          disabled.add(breakpoint);
        }
      }
    }

    // edge case when acting on a line in a file, create the breakpoint if none
    // exists
    if (fileName != null && lineNum != null &&
        enabled.size() == 0 && disabled.size() == 0)
    {
      fileName = commandLine.getValue(Options.FILE_OPTION);
      create(projectName, fileName, lineNum);
      return Services.getMessage("debugging.breakpoint.added");
    }

    String action = "enabled";
    if (enabled.size() == 0){
      for (IBreakpoint breakpoint : disabled){
        breakpoint.setEnabled(true);
      }
    }else{
      action = "disabled";
      // another edge case when acting on a line in a file, delete the
      // breakpoint if the 'delete' option was supplied
      if (fileName != null && lineNum != null &&
          enabled.size() == 1 && commandLine.hasOption("d"))
      {
        action = "removed";
        breakpointMgr.removeBreakpoint(enabled.get(0), true);
      }else{
        for (IBreakpoint breakpoint : enabled){
          breakpoint.setEnabled(false);
        }
      }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.