/* * 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.core; import org.eclipse.core.resources.IMarker; import org.eclipse.core.resources.IResource; import org.eclipse.core.runtime.CoreException; import org.eclipse.debug.core.model.IBreakpoint; import org.eclipse.debug.core.model.LineBreakpoint; import net.sourceforge.phpeclipse.xdebug.core.IXDebugConstants; /** * @author Axel * * TODO To change the template for this generated type comment go to * Window - Preferences - Java - Code Style - Code Templates */ public class XDebugLineBreakpoint extends LineBreakpoint { /** * Default constructor is required for the breakpoint manager * to re-create persisted breakpoints. After instantiating a breakpoint, * the setMarker(...) method is called to restore * this breakpoint's attributes. */ public XDebugLineBreakpoint() { } /** * Constructs a line breakpoint on the given resource at the given * line number. The line number is 1-based (i.e. the first line of a * file is line number 1). The PDA VM uses 0-based line numbers, * so this line number translation is done at breakpoint install time. * * @param resource file on which to set the breakpoint * @param lineNumber 1-based line number of the breakpoint * @throws CoreException if unable to create the breakpoint */ public XDebugLineBreakpoint(IResource resource, int lineNumber) throws CoreException { IMarker marker = resource.createMarker("org.eclipse.debug.examples.core.pda.lineBreakpoint.marker"); setMarker(marker); setEnabled(true); ensureMarker().setAttribute(IMarker.LINE_NUMBER, lineNumber); ensureMarker().setAttribute(IBreakpoint.ID, IXDebugConstants.ID_XDEBUG_DEBUG_MODEL); } /* (non-Javadoc) * @see org.eclipse.debug.core.model.IBreakpoint#getModelIdentifier() */ public String getModelIdentifier() { return IXDebugConstants.ID_XDEBUG_DEBUG_MODEL; } }