-
/*
* Created on 25.11.2004
- *
- * TODO To change the template for this generated file go to
- * Window - Preferences - Java - Code Style - Code Templates
*/
package net.sourceforge.phpeclipse.xdebug.php.model;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.debug.core.DebugPlugin;
+//import org.eclipse.debug.core.model.Breakpoint;
import org.eclipse.debug.core.model.IBreakpoint;
-import org.eclipse.debug.core.model.LineBreakpoint;
+import org.eclipse.debug.core.model.ILineBreakpoint;
+//import org.eclipse.debug.core.model.LineBreakpoint;
/**
* TODO To change the template for this generated type comment go to
* Window - Preferences - Java - Code Style - Code Templates
*/
-public class XDebugLineBreakpoint extends LineBreakpoint {
-
+public class XDebugLineBreakpoint extends XDebugBreakpoint implements ILineBreakpoint /*extends LineBreakpoint*/ {
+
/**
* Default constructor is required for the breakpoint manager
* to re-create persisted breakpoints. After instantiating a breakpoint,
* @throws CoreException if unable to create the breakpoint
*/
public XDebugLineBreakpoint(final IResource resource, final int lineNumber) throws CoreException {
-// IMarker marker = resource.createMarker("net.sourceforge.phpeclipse.xdebug.core.XDebugLineBreakpoint");
-// setMarker(marker);
-// setEnabled(true);
-// XDebugCorePlugin.log(IStatus.INFO,"Markertype: "+ marker.getType());
-// ensureMarker().setAttribute(IMarker.LINE_NUMBER, lineNumber);
-// ensureMarker().setAttribute(IBreakpoint.ID, IXDebugConstants.ID_PHP_DEBUG_MODEL);
-// ensureMarker().setAttribute(BREAKPOINT_ID,-1);
- IWorkspaceRunnable wr= new IWorkspaceRunnable() {
+ IWorkspaceRunnable wr = new IWorkspaceRunnable() {
public void run(IProgressMonitor monitor) throws CoreException {
// create the marker
return IXDebugConstants.ID_PHP_DEBUG_MODEL;
}
- public void setID(int id) throws CoreException
- {
+ public void setID(int id) throws CoreException {
ensureMarker().setAttribute(BREAKPOINT_ID,id);
}
- public int getID() throws CoreException
- {
+
+ public int getID() throws CoreException {
return ensureMarker().getAttribute(BREAKPOINT_ID,-1);
}
-}
+
+ public int getHitCount() throws CoreException {
+ return ensureMarker().getAttribute(HIT_COUNT,-1);
+ //return fHitCount;
+ }
+
+ public void setHitCount(int newHitCount) throws CoreException {
+ ensureMarker().setAttribute(HIT_COUNT,newHitCount);
+ //fHitCount = newHitCount;
+ }
+ /**
+ * @see ILineBreakpoint#getLineNumber()
+ */
+ public int getLineNumber() throws CoreException {
+ IMarker m = getMarker();
+ if (m != null) {
+ return m.getAttribute(IMarker.LINE_NUMBER, -1);
+ }
+ return -1;
+ }
+
+ /**
+ * @see ILineBreakpoint#getCharStart()
+ */
+ public int getCharStart() throws CoreException {
+ IMarker m = getMarker();
+ if (m != null) {
+ return m.getAttribute(IMarker.CHAR_START, -1);
+ }
+ return -1;
+ }
+
+ /**
+ * @see ILineBreakpoint#getCharEnd()
+ */
+ public int getCharEnd() throws CoreException {
+ IMarker m = getMarker();
+ if (m != null) {
+ return m.getAttribute(IMarker.CHAR_END, -1);
+ }
+ return -1;
+ }
+}
\ No newline at end of file