3.x RC1 compatibility
[phpeclipse.git] / net.sourceforge.phpeclipse.debug.core / src / net / sourceforge / phpdt / debug / core / PHPDebugModel.java
index 1f84446..45455ff 100644 (file)
@@ -16,6 +16,7 @@ import java.util.Map;
 
 import net.sourceforge.phpdt.internal.debug.core.PHPDebugCorePlugin;
 import net.sourceforge.phpdt.internal.debug.core.breakpoints.PHPLineBreakpoint;
+//import net.sourceforge.phpdt.internal.debug.core.breakpoints.IPHPLineBreakpoint;
 import org.eclipse.core.resources.IResource;
 import org.eclipse.core.runtime.CoreException;
 import org.eclipse.core.runtime.Preferences;
@@ -45,9 +46,9 @@ public class PHPDebugModel {
         *
         * @return plugin identifier
         */
-       public static String getPluginIdentifier() {
-               return PHPDebugCorePlugin.getUniqueIdentifier();
-       }
+//     public static String getPluginIdentifier() {
+//             return PHPDebugCorePlugin.getUniqueIdentifier();
+//     }
        
        /**
         * Creates and returns a line breakpoint in the type with
@@ -83,6 +84,14 @@ public class PHPDebugModel {
                }
                new PHPLineBreakpoint(resource, lineNumber, charStart, charEnd, hitCount, true, attributes);
        }
+       
+       public static PHPLineBreakpoint createLineBreakpoint(IResource resource, int lineNumber, int hitCount, boolean register, Map attributes) throws CoreException {
+               if (attributes == null) {
+                       attributes = new HashMap(10);
+               }
+               return new PHPLineBreakpoint(resource, lineNumber, hitCount, true, attributes);
+       }
+       
 
        /**
         * Returns true if line breakpoint is already registered with the breakpoint
@@ -95,8 +104,8 @@ public class PHPDebugModel {
         * if no such breakpoint is registered
         * @exception CoreException If this method fails.
         */
-       public static boolean lineBreakpointExists(int lineNumber) throws CoreException {
-               String modelId= getPluginIdentifier();
+       public static PHPLineBreakpoint lineBreakpointExists(int lineNumber) throws CoreException {
+               String modelId= PHPDebugCorePlugin.PLUGIN_ID; // getPluginIdentifier();
                String markerType= PHPLineBreakpoint.getMarkerType();
                IBreakpointManager manager= DebugPlugin.getDefault().getBreakpointManager();
                IBreakpoint[] breakpoints= manager.getBreakpoints(modelId);
@@ -107,11 +116,11 @@ public class PHPDebugModel {
                        PHPLineBreakpoint breakpoint = (PHPLineBreakpoint) breakpoints[i];
                        if (breakpoint.getMarker().getType().equals(markerType)) {
                                        if (breakpoint.getLineNumber() == lineNumber) {
-                                               return true;
+                                               return breakpoint;
                                        }
                        }
                }
-               return false;
+               return null;
        }       
 
        /**