org.openide.debugger
Class Watch

java.lang.Object
  |
  +--org.openide.debugger.Watch
All Implemented Interfaces:
Serializable

public abstract class Watch
extends Object
implements Serializable

Represents one debugger watch. It contains only basic information that can be used by the core of the IDE. For example, the editor can use this object to display tooltips above variable names in the edited text.

It is likely that the real implementation of the watch can offer more functionality to the user--in which case it should expose properties as a JavaBean.

See Also:
Serialized Form

Field Summary
static String PROP_AS_TEXT
          Name of the property for the value of the watched expression as a string.
static String PROP_TYPE
          Name of the property for the type of the watch value.
static String PROP_VARIABLE_NAME
          Name of the property for the watched variable name.
 
Constructor Summary
Watch()
           
 
Method Summary
abstract  void addPropertyChangeListener(PropertyChangeListener l)
          Add a property change listener.
abstract  String getAsText()
          Get a textual representation of the value.
abstract  String getType()
          Get the string representation of the type of the variable.
abstract  String getVariableName()
          Get the name of the variable to watch.
abstract  boolean isHidden()
          Test whether the watch is hidden.
abstract  void remove()
          Remove the watch from the list of all watches in the system.
abstract  void removePropertyChangeListener(PropertyChangeListener l)
          Remove a property change listener.
abstract  void setAsText(String value)
          Set the value of the watched variable (as text).
abstract  void setVariableName(String name)
          Set the variable name to watch.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PROP_VARIABLE_NAME

public static final String PROP_VARIABLE_NAME
Name of the property for the watched variable name.

PROP_AS_TEXT

public static final String PROP_AS_TEXT
Name of the property for the value of the watched expression as a string.

PROP_TYPE

public static final String PROP_TYPE
Name of the property for the type of the watch value.
Constructor Detail

Watch

public Watch()
Method Detail

remove

public abstract void remove()
Remove the watch from the list of all watches in the system.

getVariableName

public abstract String getVariableName()
Get the name of the variable to watch.
Returns:
the variable name

setVariableName

public abstract void setVariableName(String name)
Set the variable name to watch.
Parameters:
name - string name of the variable to watch

getAsText

public abstract String getAsText()
Get a textual representation of the value. The watch should convert the real value to a string representation. So if the watch represents a null reference, the returned string will be for example "null".
Returns:
the value of this watch, or null if the watch is not in scope

setAsText

public abstract void setAsText(String value)
                        throws DebuggerException
Set the value of the watched variable (as text).
Parameters:
value - text representation of the new value
Throws:
DebuggerException - if the value cannot be changed, or the string does not represent valid value, or the value type cannot reasonably be set as text

getType

public abstract String getType()
Get the string representation of the type of the variable.
Returns:
type string (i.e. the class name, or for a primitive e.g. "int")

isHidden

public abstract boolean isHidden()
Test whether the watch is hidden. If so, it is not presented in the list of all watches. Such a watch can be used for the IDE's (or some module's) private use, not displaying anything to the user.
Returns:
true if the watch is hidden
See Also:
Debugger.createWatch(String, boolean)

addPropertyChangeListener

public abstract void addPropertyChangeListener(PropertyChangeListener l)
Add a property change listener. Change events should be fired for the properties PROP_VARIABLE_NAME, PROP_AS_TEXT, and PROP_TYPE.
Parameters:
l - the listener to add

removePropertyChangeListener

public abstract void removePropertyChangeListener(PropertyChangeListener l)
Remove a property change listener.
Parameters:
l - the listener to remove


Built on December 12 2001.  |  Portions Copyright 1997-2001 Sun Microsystems, Inc. All rights reserved.