1) Added methods for conditional breakpoints and skip/hit count.
authorrobekras <robekras>
Sun, 11 Dec 2005 14:45:55 +0000 (14:45 +0000)
committerrobekras <robekras>
Sun, 11 Dec 2005 14:45:55 +0000 (14:45 +0000)
net.sourceforge.phpeclipse.debug.core/src/net/sourceforge/phpdt/internal/debug/core/breakpoints/PHPLineBreakpoint.java

index a9712ec..3d5ac2b 100644 (file)
@@ -40,7 +40,14 @@ public class PHPLineBreakpoint extends PHPBreakpoint implements IBreakpoint, ILi
        }
        
 
-       protected PHPLineBreakpoint(final IResource resource, final int lineNumber, final int charStart, final int charEnd, final int hitCount, final boolean add, final Map attributes, final String markerType) throws DebugException {
+       protected PHPLineBreakpoint (final IResource resource, 
+                                            final int lineNumber, 
+                                            final int charStart, 
+                                            final int charEnd, 
+                                            final int hitCount, 
+                                            final boolean add, 
+                                            final Map attributes, 
+                                            final String markerType) throws DebugException {
                IWorkspaceRunnable wr= new IWorkspaceRunnable() {
                        public void run(IProgressMonitor monitor) throws CoreException {
        
@@ -48,7 +55,7 @@ public class PHPLineBreakpoint extends PHPBreakpoint implements IBreakpoint, ILi
                                setMarker(resource.createMarker(markerType));
 
                                // add attributes
-                               addLineBreakpointAttributes(attributes, getModelIdentifier(), true, lineNumber, charStart, charEnd);
+                               addLineBreakpointAttributes(attributes, getModelIdentifier(), true, lineNumber, charStart, charEnd, hitCount);
 
                                // set attributes
                                ensureMarker().setAttributes(attributes);
@@ -61,7 +68,7 @@ public class PHPLineBreakpoint extends PHPBreakpoint implements IBreakpoint, ILi
        }
        
 
-       public void addLineBreakpointAttributes(Map attributes, String modelIdentifier, boolean enabled, int lineNumber, int charStart, int charEnd) {
+       public void addLineBreakpointAttributes(Map attributes, String modelIdentifier, boolean enabled, int lineNumber, int charStart, int charEnd, int hitCount) {
                attributes.put(IBreakpoint.ID, modelIdentifier);
                attributes.put(IBreakpoint.ENABLED, new Boolean(enabled));
                attributes.put(IMarker.LINE_NUMBER, new Integer(lineNumber));
@@ -71,6 +78,10 @@ public class PHPLineBreakpoint extends PHPBreakpoint implements IBreakpoint, ILi
                        attributes.put(IMarker.CHAR_END, new Integer(charEnd));
                }
                attributes.put(TYPE_NAME, "typeName"); 
+               attributes.put(PHPBreakpoint.HIT_COUNT, new Integer(hitCount));
+               attributes.put(PHPBreakpoint.CONDITION, new String(""));
+               attributes.put(PHPBreakpoint.CONDITION_ENABLED, new Boolean(false));
+               attributes.put(PHPBreakpoint.CHANGE_ID, new Integer(0));
        }               
 
        /**
@@ -99,5 +110,33 @@ public class PHPLineBreakpoint extends PHPBreakpoint implements IBreakpoint, ILi
         */
        public static String getMarkerType() {
                return PHP_LINE_BREAKPOINT;
-       }       
+       }
+       
+       public int getHitCount() throws CoreException {
+               return ensureMarker().getAttribute(PHPBreakpoint.HIT_COUNT, 1);
+       }
+       
+       public int getChangeID() throws CoreException {
+               return ensureMarker().getAttribute(CHANGE_ID, 1);
+       }
+       
+       public void setChangeID(int changeID) throws CoreException {
+               ensureMarker().setAttribute(CHANGE_ID, changeID);
+       }
+
+       public String getCondition () throws CoreException {
+               return ensureMarker ().getAttribute (CONDITION, "");
+       }
+       
+       public void setCondition (String condition) throws CoreException {
+               ensureMarker ().setAttribute (CONDITION, condition);
+       }
+
+       public void setConditionEnabled (boolean enabled) throws CoreException {
+               ensureMarker ().setAttribute (CONDITION_ENABLED, enabled);
+       }
+
+       public boolean isConditionEnabled () throws CoreException {
+               return ensureMarker ().getAttribute (CONDITION_ENABLED, false);
+       }
 }
\ No newline at end of file