Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDarin Wright2001-08-30 13:07:42 +0000
committerDarin Wright2001-08-30 13:07:42 +0000
commit141322bbe119f164fadcade5c14fe8ee4fedbb74 (patch)
tree5c618c81a1a3abf7bb8d434eba2389fbb20877b4
parent4d7f7a2cba4b1aeecf11b2fa237c18c1b33da8ae (diff)
downloadeclipse.platform.debug-141322bbe119f164fadcade5c14fe8ee4fedbb74.tar.gz
eclipse.platform.debug-141322bbe119f164fadcade5c14fe8ee4fedbb74.tar.xz
eclipse.platform.debug-141322bbe119f164fadcade5c14fe8ee4fedbb74.zip
Interface cleanup
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/core/IBreakpoint.java29
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/internal/core/Breakpoint.java35
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/EnableDisableBreakpointAction.java3
3 files changed, 12 insertions, 55 deletions
diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/IBreakpoint.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/IBreakpoint.java
index e0bddef8d..6cb25649c 100644
--- a/org.eclipse.debug.core/core/org/eclipse/debug/core/IBreakpoint.java
+++ b/org.eclipse.debug.core/core/org/eclipse/debug/core/IBreakpoint.java
@@ -19,15 +19,6 @@ public interface IBreakpoint {
*/
public void delete() throws CoreException;
/**
- * Tests this breakpoint for equality with the given object.
- * Two breakpoints are equal if their markers have the same id.
- * Markers are assigned an id when created on a resource.
- *
- * @param object the other object
- * @return an indication of whether the objects are equal
- */
-public boolean equals(Object object);
-/**
* Returns whether this marker exists in the workspace. A marker
* exists if its resource exists and has a marker with the marker's id.
*
@@ -36,14 +27,6 @@ public boolean equals(Object object);
*/
public boolean exists();
/**
- * Enable this breakpoint
- */
-public void enable() throws CoreException;
-/**
- * Disable this breakpoint
- */
-public void disable() throws CoreException;
-/**
* Returns the marker associated with the breakpoint.
*
* @return the marker, or <code>null</code> if the marker does not exist.
@@ -87,15 +70,11 @@ public String getType() throws CoreException;
*/
public boolean isEnabled() throws CoreException;
/**
- * Returns whether this breakpoint is disabled
- */
-public boolean isDisabled() throws CoreException;
-/**
- * Sets the enabled state of this breakpoint to the opposite of its
- * current state.
+ * Set the enabled state of this breakpoint.
+ *
+ * @param enabled whether this breakpoint should be enabled
*/
-public void toggleEnabled() throws CoreException;
-
+public void setEnabled(boolean enabled) throws CoreException;
/**
* Install a breakpoint request for this breakpoint in the given target.
*
diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/Breakpoint.java b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/Breakpoint.java
index 0a89b0739..9ae325392 100644
--- a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/Breakpoint.java
+++ b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/Breakpoint.java
@@ -58,7 +58,7 @@ public abstract class Breakpoint implements IBreakpoint {
* A breakpoint is not equal to any other kind of object.
*/
public boolean equals(Object item) {
- if (item instanceof IBreakpoint) {
+ if (item instanceof Breakpoint) {
return getId() == ((IBreakpoint)item).getId();
}
return false;
@@ -102,10 +102,12 @@ public abstract class Breakpoint implements IBreakpoint {
public abstract void removeFromTarget(IDebugTarget target);
/**
- * Enable the breakpoint
+ * @see IBreakpoint#setEnabled(boolean)
*/
- public void enable() throws CoreException {
- fMarker.setAttribute(IDebugConstants.ENABLED, true);
+ public void setEnabled(boolean enabled) throws CoreException {
+ if (enabled != isEnabled()) {
+ fMarker.setAttribute(IDebugConstants.ENABLED, enabled);
+ }
}
/**
@@ -114,31 +116,6 @@ public abstract class Breakpoint implements IBreakpoint {
public boolean isEnabled() throws CoreException {
return fMarker.getAttribute(IDebugConstants.ENABLED, false);
}
-
- /**
- * @see IBreakpoint#toggleEnabled()
- */
- public void toggleEnabled() throws CoreException {
- if (isEnabled()) {
- disable();
- } else {
- enable();
- }
- }
-
- /**
- * Disable the breakpoint
- */
- public void disable() throws CoreException {
- fMarker.setAttribute(IDebugConstants.ENABLED, false);
- }
-
- /**
- * Returns whether the breakpoint is disabled
- */
- public boolean isDisabled() throws CoreException {
- return !isEnabled();
- }
/**
* @see IBreakpoint#delete()
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/EnableDisableBreakpointAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/EnableDisableBreakpointAction.java
index eb324c6ce..e6865c3d7 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/EnableDisableBreakpointAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/EnableDisableBreakpointAction.java
@@ -54,7 +54,8 @@ public class EnableDisableBreakpointAction extends SelectionProviderAction imple
while (enum.hasNext()) {
IMarker marker= (IMarker) enum.next();
try {
- getBreakpoint(marker).toggleEnabled();
+ IBreakpoint breakpoint= getBreakpoint(marker);
+ breakpoint.setEnabled(!breakpoint.isEnabled());
} catch (CoreException e) {
ms.merge(e.getStatus());
}

Back to the top