Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDarin Swanson2001-08-02 13:17:17 +0000
committerDarin Swanson2001-08-02 13:17:17 +0000
commit7cad49a95a18a0e029e70df987e47d84a70b4f88 (patch)
tree91c9fc37272cea05c4fa05bdfb7fcbff79852754
parentb54845d121aad0e578138ebc2a98b2753aaa5ecd (diff)
downloadeclipse.platform.debug-7cad49a95a18a0e029e70df987e47d84a70b4f88.tar.gz
eclipse.platform.debug-7cad49a95a18a0e029e70df987e47d84a70b4f88.tar.xz
eclipse.platform.debug-7cad49a95a18a0e029e70df987e47d84a70b4f88.zip
*** empty log message ***bp_exp_003
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/core/IBreakpoint.java218
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/core/IBreakpointManager.java18
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/internal/core/Breakpoint.java292
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/internal/core/BreakpointManager.java8
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DelegatingModelPresentation.java9
5 files changed, 256 insertions, 289 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 340ebbf3e..b4c8a73aa 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
@@ -169,26 +169,7 @@ public interface IBreakpoint {
*/
public static final int SEVERITY_INFO = 0;
-/**
- * Configures the given breakpoint's <code>MODEL_IDENTIFIER</code>
- * and <code>ENABLED</code> attributes to the given values.
- * This is a convenience method for
- * <code>IMarker.setAttribute(String, Object)</code> and
- * <code>IMarker.setAttribute(String, boolean)</code>.
- * <code>IMarker.setAttribute(String, int)</code>.
- *
- * @param breakpoint the breakpoint marker to configure
- * @param modelIdentifier the identifier of the debug model plug-in
- * the breakpoint is associated with
- * @param enabled the initial value of the enabled attribute of the
- * breakpoint marker
- *
- * @exception CoreException if setting an attribute fails
- * @see IMarker#setAttribute(String, Object)
- * @see IMarker#setAttribute(String, boolean)
- * @see IMarker#setAttribute(String, int)
- */
-public void configure(String modelIdentifier, boolean enabled) throws CoreException;
+
/**
* Deletes this marker from its associated resource. This method has no
* effect if this marker does not exist.
@@ -234,78 +215,38 @@ public IMarker getMarker();
* Returns the model identifier for this breakpoint.
*/
public String getModelIdentifier();
+
/**
- * Returns the attribute with the given name. The result is an instance of one
- * of the following classes: <code>String</code>, <code>Integer</code>,
- * or <code>Boolean</code>.
- * Returns <code>null</code> if the attribute is undefined.
- *
- * @param attributeName the name of the attribute
- * @return the value, or <code>null</code> if the attribute is undefined.
- * @exception CoreException if this method fails. Reasons include:
- * <ul>
- * <li> This marker does not exist.</li>
- * </ul>
- */
-public Object getAttribute(String attributeName) throws CoreException;
-/**
- * Returns the integer-valued attribute with the given name.
- * Returns the given default value if the attribute is undefined.
- * or the marker does not exist or is not an integer value.
- *
- * @param attributeName the name of the attribute
- * @param defaultValue the value to use if no value is found
- * @return the value or the default value if no value was found.
- */
-public int getAttribute(String attributeName, int defaultValue);
-/**
- * Returns the string-valued attribute with the given name.
- * Returns the given default value if the attribute is undefined
- * or the marker does not exist or is not a string value.
- *
- * @param attributeName the name of the attribute
- * @param defaultValue the value to use if no value is found
- * @return the value or the default value if no value was found.
- */
-public String getAttribute(String attributeName, String defaultValue);
-/**
- * Returns the boolean-valued attribute with the given name.
- * Returns the given default value if the attribute is undefined
- * or the marker does not exist or is not a boolean value.
+ * Returns the value of the <code>LINE_NUMBER</code> attribute of the
+ * given breakpoint or -1 if the attribute is not present or
+ * an exception occurs while accessing the attribute. This is a
+ * convenience method for <code>IMarker.getAttribute(String, int)</code>.
*
- * @param attributeName the name of the attribute
- * @param defaultValue the value to use if no value is found
- * @return the value or the default value if no value was found.
+ * @param breakpoint the breakpoint
+ * @return the breakpoint's line number, or -1 if unknown
*/
-public boolean getAttribute(String attributeName, boolean defaultValue);
+public int getLineNumber();
/**
- * Returns a map with all the attributes for the marker.
- * If the marker has no attributes then <code>null</code> is returned.
- *
- * @return a map of attribute keys and values (key type : <code>String</code>
- * value type : <code>String</code>, <code>Integer</code>, or
- * <code>Boolean</code>) or <code>null</code>.
- * @exception CoreException if this method fails. Reasons include:
- * <ul>
- * <li> This marker does not exist.</li>
- * </ul>
+ * Returns the value of the <code>CHAR_START</code> attribute of the
+ * given breakpoint or -1 if the attribute is not present, or
+ * an exception occurs while accessing the attribute. This is a
+ * convenience method for <code>IMarker.getAttribute(String, int)</code>
+ *
+ * @param breakpoint the breakpoint
+ * @return the breakpoint's char start value, or -1 if unknown
*/
-public Map getAttributes() throws CoreException;
+public int getCharStart();
/**
- * Returns the attributes with the given names. The result is an an array
- * whose elements correspond to the elements of the given attribute name
- * array. Each element is <code>null</code> or an instance of one
- * of the following classes: <code>String</code>, <code>Integer</code>,
- * or <code>Boolean</code>.
+ * Returns the value of the <code>CHAR_END</code> attribute of the
+ * given breakpoint or -1 if the attribute is not present or
+ * an exception occurs while accessing the attribute.
+ * This is a convenience method for <code>IMarker.getAttribute(String, int)</code>.
*
- * @param attributeNames the names of the attributes
- * @return the values of the given attributes.
- * @exception CoreException if this method fails. Reasons include:
- * <ul>
- * <li> This marker does not exist.</li>
- * </ul>
+ * @param breakpoint the breakpoint
+ * @return the breakpoint's char end value, or -1 if unknown
*/
-public Object[] getAttributes(String[] attributeNames) throws CoreException;
+public int getCharEnd();
+
/**
* Returns the id of the marker. The id of a marker is unique
* relative to the resource with which the marker is associated.
@@ -322,7 +263,7 @@ public long getId();
*/
public IResource getResource();
/**
- * Returns the type of this marker.
+ * Returns the type of this breakpoint.
*
* @return the type of this marker
* @exception CoreException if this method fails. Reasons include:
@@ -344,112 +285,7 @@ public boolean isDisabled() throws CoreException;
* current state.
*/
public void toggleEnabled() throws CoreException;
-/**
- * Returns whether the type of this marker is considered to be a subtype of
- * the given marker type.
- *
- * @return boolean <code>true</code>if the marker's type
- * is the same as (or a subtype of) the given type.
- * @exception CoreException if this method fails. Reasons include:
- * <ul>
- * <li> This marker does not exist.</li>
- * </ul>
- */
-public boolean isSubtypeOf(String superType) throws CoreException;
-/**
- * Sets the integer-valued attribute with the given name.
- * <p>
- * This method changes resources; these changes will be reported
- * in a subsequent resource change event, including an indication
- * that this marker has been modified.
- * </p>
- *
- * @param attributeName the name of the attribute
- * @param value the value
- * @exception CoreException if this method fails. Reasons include:
- * <ul>
- * <li> This marker does not exist.</li>
- * </ul>
- */
-public void setAttribute(String attributeName, int value) throws CoreException;
-/**
- * Sets the attribute with the given name. The value must be <code>null</code> or
- * an instance of one of the following classes:
- * <code>String</code>, <code>Integer</code>, or <code>Boolean</code>.
- * If the value is <code>null</code>, the attribute is considered to be undefined.
- * <p>
- * This method changes resources; these changes will be reported
- * in a subsequent resource change event, including an indication
- * that this marker has been modified.
- * </p>
- *
- * @param attributeName the name of the attribute
- * @param value the value, or <code>null</code> if the attribute is to be undefined
- * @exception CoreException if this method fails. Reasons include:
- * <ul>
- * <li> This marker does not exist.</li>
- * </ul>
- */
-public void setAttribute(String attributeName, Object value) throws CoreException;
-/**
- * Sets the boolean-valued attribute with the given name.
- * <p>
- * This method changes resources; these changes will be reported
- * in a subsequent resource change event, including an indication
- * that this marker has been modified.
- * </p>
- *
- * @param attributeName the name of the attribute
- * @param value the value
- * @exception CoreException if this method fails. Reasons include:
- * <ul>
- * <li> This marker does not exist.</li>
- * </ul>
- */
-public void setAttribute(String attributeName, boolean value) throws CoreException;
-/**
- * Sets the given attribute key-value pairs on this marker.
- * The values must be <code>null</code> or an instance of
- * one of the following classes: <code>String</code>,
- * <code>Integer</code>, or <code>Boolean</code>.
- * If a value is <code>null</code>, the new value of the
- * attribute is considered to be undefined.
- * <p>
- * This method changes resources; these changes will be reported
- * in a subsequent resource change event, including an indication
- * that this marker has been modified.
- * </p>
- *
- * @param attributeNames an array of attribute names
- * @param values an array of attribute values
- * @exception CoreException if this method fails. Reasons include:
- * <ul>
- * <li> This marker does not exist.</li>
- * </ul>
- */
-public void setAttributes(String[] attributeNames, Object[] values) throws CoreException;
-/**
- * Sets the attributes for this marker to be the ones contained in the
- * given table. The values must be an instance of one of the following classes:
- * <code>String</code>, <code>Integer</code>, or <code>Boolean</code>.
- * Attributes previously set on the marker but not included in the given map
- * are considered to be removals. Setting the given map to be <code>null</code>
- * is equivalent to removing all marker attributes.
- * <p>
- * This method changes resources; these changes will be reported
- * in a subsequent resource change event, including an indication
- * that this marker has been modified.
- * </p>
- *
- * @param attributes a map of attribute names to attribute values
- * (key type : <code>String</code> value type : <code>String</code>,
- * <code>Integer</code>, or <code>Boolean</code>) or <code>null</code>
- * @exception CoreException if this method fails. Reasons include:
- * <ul>
- * <li> This marker does not exist.</li>
- * </ul>
- */
-public void setAttributes(Map attributes) throws CoreException;
+
/**
* Install a breakpoint request for this breakpoint in the given target.
*
diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/IBreakpointManager.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/IBreakpointManager.java
index ce12ae509..ef94dc5e3 100644
--- a/org.eclipse.debug.core/core/org/eclipse/debug/core/IBreakpointManager.java
+++ b/org.eclipse.debug.core/core/org/eclipse/debug/core/IBreakpointManager.java
@@ -157,26 +157,24 @@ public interface IBreakpointManager {
boolean isRegistered(IMarker marker);
/**
- * Returns the value of the <code>LINE_NUMBER</code> attribute of the
+ * Returns the value of the line number attribute of the
* given breakpoint or -1 if the attribute is not present or
- * an exception occurs while accessing the attribute. This is a
- * convenience method for <code>IMarker.getAttribute(String, int)</code>.
- *
+ * an exception occurs while accessing the attribute.
+ *
* @param breakpoint the breakpoint
* @return the breakpoint's line number, or -1 if unknown
*/
- int getLineNumber(IMarker breakpoint);
+ int getLineNumber(IMarker marker);
/**
- * Returns the value of the <code>CHAR_START</code> attribute of the
+ * Returns the value of the char start attribute of the
* given breakpoint or -1 if the attribute is not present, or
- * an exception occurs while accessing the attribute. This is a
- * convenience method for <code>IMarker.getAttribute(String, int)</code>
+ * an exception occurs while accessing the attribute.
*
* @param breakpoint the breakpoint
* @return the breakpoint's char start value, or -1 if unknown
*/
- int getCharStart(IMarker breakpoint);
+ int getCharStart(IMarker marker);
/**
* Returns the value of the <code>CHAR_END</code> attribute of the
@@ -187,7 +185,7 @@ public interface IBreakpointManager {
* @param breakpoint the breakpoint
* @return the breakpoint's char end value, or -1 if unknown
*/
- int getCharEnd(IMarker breakpoint);
+ int getCharEnd(IMarker marker);
/**
* Returns the value of the <code>MODEL_IDENTIFIER</code> attribute of the
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 c801c7e98..7a1559031 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
@@ -29,7 +29,12 @@ public abstract class Breakpoint implements IBreakpoint {
* Create a breakpoint for the given marker
*/
public Breakpoint(IMarker marker) {
- fMarker= marker;
+ try {
+ if (marker.isSubtypeOf(IDebugConstants.BREAKPOINT_MARKER)) {
+ fMarker= marker;
+ }
+ } catch (CoreException ce) {
+ }
}
/**
@@ -46,7 +51,22 @@ public abstract class Breakpoint implements IBreakpoint {
}
/**
- * @see IBreakpoint
+ * Configures the given breakpoint's <code>MODEL_IDENTIFIER</code>
+ * and <code>ENABLED</code> attributes to the given values.
+ * This is a convenience method for
+ * <code>IBreakpoint.setAttribute(String, Object)</code> and
+ * <code>IBreakpoint.setAttribute(String, boolean)</code>.
+ * <code>IBreakpoint.setAttribute(String, int)</code>.
+ *
+ * @param modelIdentifier the identifier of the debug model plug-in
+ * the breakpoint is associated with
+ * @param enabled the initial value of the enabled attribute of the
+ * breakpoint marker
+ *
+ * @exception CoreException if setting an attribute fails
+ * @see IBreakpoint#setAttribute(String, Object)
+ * @see IBreakpoint#setAttribute(String, boolean)
+ * @see IBreakpoint#setAttribute(String, int)
*/
public void configure(String modelIdentifier, boolean enabled) throws CoreException {
setAttributes(fgBreakpointAttributes, new Object[]{modelIdentifier, new Boolean(enabled)});
@@ -120,6 +140,7 @@ public abstract class Breakpoint implements IBreakpoint {
return fMarker.exists();
}
+
/**
* @see IBreakpoint#getMarker()
*/
@@ -128,154 +149,269 @@ public abstract class Breakpoint implements IBreakpoint {
}
/**
- * @see IBreakpoint#getAttribute(String)
+ * @see IBreakpoint#getId()
*/
- public Object getAttribute(String attributeName) throws CoreException {
- return fMarker.getAttribute(attributeName);
+ public long getId() {
+ return fMarker.getId();
}
/**
- * @see IBreakpoint#getAttribute(String, int)
+ * @see IBreakpoint#getResource()
*/
- public int getAttribute(String attributeName, int defaultValue) {
- return fMarker.getAttribute(attributeName, defaultValue);
- }
+ public IResource getResource() {
+ return fMarker.getResource();
+ }
/**
- * @see IBreakpoint#getAttribute(String, String)
+ * @see IBreakpoint#getType()
*/
- public String getAttribute(String attributeName, String defaultValue) {
- return fMarker.getAttribute(attributeName, defaultValue);
+ public String getType() throws CoreException {
+ return fMarker.getType();
}
/**
- * @see IBreakpoint#getAttribute(String, boolean)
+ * @see IBreakpoint
*/
- public boolean getAttribute(String attributeName, boolean defaultValue) {
- return fMarker.getAttribute(attributeName, defaultValue);
+ public int getLineNumber() {
+ return getAttribute(IMarker.LINE_NUMBER, -1);
}
/**
- * @see IBreakpoint#getAttributes()
+ * @see IBreakpoint
*/
- public Map getAttributes() throws CoreException {
- return fMarker.getAttributes();
+ public int getCharStart() {
+ return getAttribute(IMarker.CHAR_START, -1);
}
/**
- * @see IBreakpoint#getAttributes(String[])
+ * @see IBreakpoint
*/
- public Object[] getAttributes(String[] attributeNames) throws CoreException {
- return fMarker.getAttributes(attributeNames);
+ public int getCharEnd() {
+ return getAttribute(IMarker.CHAR_END, -1);
}
-
+
/**
- * Sets the <code>boolean</code> attribute of the given breakpoint.
+ * Returns the model identifier for the given breakpoint.
*/
- protected void setBooleanAttribute(String attribute, boolean value) throws CoreException {
- setAttribute(attribute, value);
+ public String getModelIdentifier() {
+ return (String)getAttribute(IDebugConstants.MODEL_IDENTIFIER, null);
}
-
+
/**
- * Returns the <code>boolean</code> attribute of the given breakpoint
- * or <code>false</code> if the attribute is not set.
- */
- protected boolean getBooleanAttribute(String attribute) {
- return getAttribute(attribute, false);
- }
+ * Returns the attribute with the given name. The result is an instance of one
+ * of the following classes: <code>String</code>, <code>Integer</code>,
+ * or <code>Boolean</code>.
+ * Returns <code>null</code> if the attribute is undefined.
+ *
+ * @param attributeName the name of the attribute
+ * @return the value, or <code>null</code> if the attribute is undefined.
+ * @exception CoreException if this method fails. Reasons include:
+ * <ul>
+ * <li> This breakpoint does not exist.</li>
+ * </ul>
+ */
+ protected Object getAttribute(String attributeName) throws CoreException {
+ return fMarker.getAttribute(attributeName);
+ }
/**
- * @see IBreakpoint#getId()
+ * Returns the integer-valued attribute with the given name.
+ * Returns the given default value if the attribute is undefined.
+ * or the marker does not exist or is not an integer value.
+ *
+ * @param attributeName the name of the attribute
+ * @param defaultValue the value to use if no value is found
+ * @return the value or the default value if no value was found.
*/
- public long getId() {
- return fMarker.getId();
+ protected int getAttribute(String attributeName, int defaultValue) {
+ return fMarker.getAttribute(attributeName, defaultValue);
}
/**
- * @see IBreakpoint#getResource()
+ * Returns the string-valued attribute with the given name.
+ * Returns the given default value if the attribute is undefined
+ * or the marker does not exist or is not a string value.
+ *
+ * @param attributeName the name of the attribute
+ * @param defaultValue the value to use if no value is found
+ * @return the value or the default value if no value was found.
*/
- public IResource getResource() {
- return fMarker.getResource();
+ protected String getAttribute(String attributeName, String defaultValue) {
+ return fMarker.getAttribute(attributeName, defaultValue);
}
-
+
/**
- * @see IBreakpoint#getType()
+ * Returns the boolean-valued attribute with the given name.
+ * Returns the given default value if the attribute is undefined
+ * or the marker does not exist or is not a boolean value.
+ * @param attributeName the name of the attribute
+ * @param defaultValue the value to use if no value is found
+ * @return the value or the default value if no value was found.
*/
- public String getType() throws CoreException {
- return fMarker.getType();
+ protected boolean getAttribute(String attributeName, boolean defaultValue) {
+ return fMarker.getAttribute(attributeName, defaultValue);
}
/**
- * @see IBreakpointManager
- */
- public int getLineNumber() {
- return getAttribute(IMarker.LINE_NUMBER, -1);
+ * Returns a map with all the attributes for the marker.
+ * If the marker has no attributes then <code>null</code> is returned.
+ *
+ * @return a map of attribute keys and values (key type : <code>String</code>
+ * value type : <code>String</code>, <code>Integer</code>, or
+ * <code>Boolean</code>) or <code>null</code>.
+ * @exception CoreException if this method fails. Reasons include:
+ * <ul>
+ * <li> The marker does not exist.</li>
+ * </ul>
+ */
+ protected Map getAttributes() throws CoreException {
+ return fMarker.getAttributes();
}
/**
- * @see IBreakpointManager
- */
- public int getCharStart() {
- return getAttribute(IMarker.CHAR_START, -1);
+ * Returns the attributes with the given names. The result is an an array
+ * whose elements correspond to the elements of the given attribute name
+ * array. Each element is <code>null</code> or an instance of one
+ * of the following classes: <code>String</code>, <code>Integer</code>,
+ * or <code>Boolean</code>.
+ *
+ * @param attributeNames the names of the attributes
+ * @return the values of the given attributes.
+ * @exception CoreException if this method fails. Reasons include:
+ * <ul>
+ * <li> The marker does not exist.</li>
+ * </ul>
+ */
+ protected Object[] getAttributes(String[] attributeNames) throws CoreException {
+ return fMarker.getAttributes(attributeNames);
}
- /**
- * @see IBreakpointManager
- */
- public int getCharEnd() {
- return getAttribute(IMarker.CHAR_END, -1);
- }
/**
- * Returns the model identifier for the given breakpoint.
+ * Returns the <code>boolean</code> attribute of the given breakpoint
+ * or <code>false</code> if the attribute is not set.
*/
- public String getModelIdentifier() {
- return (String)getAttribute(IDebugConstants.MODEL_IDENTIFIER, null);
+ protected boolean getBooleanAttribute(String attribute) {
+ return getAttribute(attribute, false);
}
/**
- * @see IBreakpoint#isSubtypeOf(String)
+ * Sets the <code>boolean</code> attribute of the given breakpoint.
*/
- public boolean isSubtypeOf(String superType) throws CoreException {
- return fMarker.isSubtypeOf(superType);
- }
+ protected void setBooleanAttribute(String attribute, boolean value) throws CoreException {
+ setAttribute(attribute, value);
+ }
/**
- * @see IBreakpoint#setAttribute(String, int)
- */
- public void setAttribute(String attributeName, int value)
+ * Sets the integer-valued attribute with the given name.
+ * <p>
+ * This method changes resources; these changes will be reported
+ * in a subsequent resource change event, including an indication
+ * that this marker has been modified.
+ * </p>
+ *
+ * @param attributeName the name of the attribute
+ * @param value the value
+ * @exception CoreException if this method fails. Reasons include:
+ * <ul>
+ * <li> This marker does not exist.</li>
+ * </ul>
+ */
+ protected void setAttribute(String attributeName, int value)
throws CoreException {
fMarker.setAttribute(attributeName, value);
}
/**
- * @see IBreakpoint#setAttribute(String, Object)
- */
- public void setAttribute(String attributeName, Object value)
+ * Sets the attribute with the given name. The value must be <code>null</code> or
+ * an instance of one of the following classes:
+ * <code>String</code>, <code>Integer</code>, or <code>Boolean</code>.
+ * If the value is <code>null</code>, the attribute is considered to be undefined.
+ * <p>
+ * This method changes resources; these changes will be reported
+ * in a subsequent resource change event, including an indication
+ * that this marker has been modified.
+ * </p>
+ *
+ * @param attributeName the name of the attribute
+ * @param value the value, or <code>null</code> if the attribute is to be undefined
+ * @exception CoreException if this method fails. Reasons include:
+ * <ul>
+ * <li> The marker does not exist.</li>
+ * </ul>
+ */
+ protected void setAttribute(String attributeName, Object value)
throws CoreException {
fMarker.setAttribute(attributeName, value);
}
/**
- * @see IBreakpoint#setAttribute(String, boolean)
- */
- public void setAttribute(String attributeName, boolean value)
+ * Sets the boolean-valued attribute with the given name.
+ * <p>
+ * This method changes resources; these changes will be reported
+ * in a subsequent resource change event, including an indication
+ * that this marker has been modified.
+ * </p>
+ *
+ * @param attributeName the name of the attribute
+ * @param value the value
+ * @exception CoreException if this method fails. Reasons include:
+ * <ul>
+ * <li> The marker does not exist.</li>
+ * </ul>
+ */
+ protected void setAttribute(String attributeName, boolean value)
throws CoreException {
fMarker.setAttribute(attributeName, value);
}
/**
- * @see IBreakpoint#setAttributes(String[], Object[])
- */
- public void setAttributes(String[] attributeNames, Object[] values)
+ * Sets the given attribute key-value pairs on this marker.
+ * The values must be <code>null</code> or an instance of
+ * one of the following classes: <code>String</code>,
+ * <code>Integer</code>, or <code>Boolean</code>.
+ * If a value is <code>null</code>, the new value of the
+ * attribute is considered to be undefined.
+ * <p>
+ * This method changes resources; these changes will be reported
+ * in a subsequent resource change event, including an indication
+ * that this marker has been modified.
+ * </p>
+ *
+ * @param attributeNames an array of attribute names
+ * @param values an array of attribute values
+ * @exception CoreException if this method fails. Reasons include:
+ * <ul>
+ * <li> This marker does not exist.</li>
+ * </ul>
+ */
+ protected void setAttributes(String[] attributeNames, Object[] values)
throws CoreException {
fMarker.setAttributes(attributeNames, values);
}
/**
- * @see IBreakpoint#setAttributes(Map)
- */
- public void setAttributes(Map attributes) throws CoreException {
+ * Sets the attributes for this marker to be the ones contained in the
+ * given table. The values must be an instance of one of the following classes:
+ * <code>String</code>, <code>Integer</code>, or <code>Boolean</code>.
+ * Attributes previously set on the marker but not included in the given map
+ * are considered to be removals. Setting the given map to be <code>null</code>
+ * is equivalent to removing all marker attributes.
+ * <p>
+ * This method changes resources; these changes will be reported
+ * in a subsequent resource change event, including an indication
+ * that this marker has been modified.
+ * </p>
+ *
+ * @param attributes a map of attribute names to attribute values
+ * (key type : <code>String</code> value type : <code>String</code>,
+ * <code>Integer</code>, or <code>Boolean</code>) or <code>null</code>
+ * @exception CoreException if this method fails. Reasons include:
+ * <ul>
+ * <li> The marker does not exist.</li>
+ * </ul>
+ */
+ protected void setAttributes(Map attributes) throws CoreException {
fMarker.setAttributes(attributes);
}
diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/BreakpointManager.java b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/BreakpointManager.java
index 2d2bcf708..97a845527 100644
--- a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/BreakpointManager.java
+++ b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/BreakpointManager.java
@@ -183,21 +183,21 @@ public class BreakpointManager implements IBreakpointManager, IResourceChangeLis
* @see IBreakpointManager
*/
public int getLineNumber(IMarker marker) {
- return getBreakpoint(marker).getAttribute(IMarker.LINE_NUMBER, -1);
+ return getBreakpoint(marker).getLineNumber();
}
/**
* @see IBreakpointManager
*/
public int getCharStart(IMarker marker) {
- return getBreakpoint(marker).getAttribute(IMarker.CHAR_START, -1);
+ return getBreakpoint(marker).getCharStart();
}
/**
* @see IBreakpointManager
*/
public int getCharEnd(IMarker marker) {
- return getBreakpoint(marker).getAttribute(IMarker.CHAR_END, -1);
+ return getBreakpoint(marker).getCharEnd();
}
/**
@@ -288,7 +288,7 @@ public class BreakpointManager implements IBreakpointManager, IResourceChangeLis
*/
protected void verifyBreakpoint(IBreakpoint breakpoint) throws DebugException {
try {
- String id= (String) breakpoint.getAttribute(IDebugConstants.MODEL_IDENTIFIER);
+ String id= breakpoint.getModelIdentifier();
if (id == null) {
throw new DebugException(new Status(IStatus.ERROR, DebugPlugin.getDefault().getDescriptor().getUniqueIdentifier(),
IDebugStatusConstants.CONFIGURATION_INVALID, DebugCoreUtils.getResourceString(REQUIRED_ATTRIBUTES), null));
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DelegatingModelPresentation.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DelegatingModelPresentation.java
index 5f89fbfb0..100f0083c 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DelegatingModelPresentation.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DelegatingModelPresentation.java
@@ -183,11 +183,8 @@ public class DelegatingModelPresentation implements IDebugModelPresentation {
if (element instanceof IMarker) {
IMarker marker= (IMarker) element;
IBreakpoint breakpoint= DebugPlugin.getDefault().getBreakpointManager().getBreakpoint(marker);
- try {
- if (breakpoint.exists() && breakpoint.isSubtypeOf(IDebugConstants.BREAKPOINT_MARKER)) {
- return DebugUIUtils.getResourceString(BREAKPOINT_LABEL);
- }
- } catch (CoreException e) {
+ if (breakpoint.exists()) {
+ return DebugUIUtils.getResourceString(BREAKPOINT_LABEL);
}
}
return DebugUIUtils.getResourceString(UNKNOWN);
@@ -230,7 +227,7 @@ public class DelegatingModelPresentation implements IDebugModelPresentation {
try {
IMarker marker= (IMarker) element;
IBreakpoint breakpoint= DebugPlugin.getDefault().getBreakpointManager().getBreakpoint(marker);
- if (breakpoint.exists() && breakpoint.isSubtypeOf(IDebugConstants.BREAKPOINT_MARKER)) {
+ if (breakpoint.exists()) {
if (breakpoint.isEnabled()) {
return DebugPluginImages.getImage(IDebugUIConstants.IMG_OBJS_BREAKPOINT);
} else {

Back to the top