<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<!--NewPage-->
<html>
<head>
<!-- Generated by javadoc on Wed Jul 28 01:21:15 GMT 1999 -->
<title>
  Interface java.beans.PropertyEditor
</title>
</head>
<body>
<a name="_top_"></a>
<pre>
<a href="packages.html">All Packages</a>  <a href="tree.html">Class Hierarchy</a>  <a href="Package-java.beans.html">This Package</a>  <a href="java.beans.PropertyChangeListener.html#_top_">Previous</a>  <a href="java.beans.VetoableChangeListener.html#_top_">Next</a>  <a href="AllNames.html">Index</a></pre>
<hr>
<h1>
  Interface java.beans.PropertyEditor
</h1>
<dl>
  <dt> public interface <b>PropertyEditor</b>
</dl>
A PropertyEditor class provides support for GUIs that want to
 allow users to edit a property value of a given type.
 <p>
 PropertyEditor supports a variety of different kinds of ways of
 displaying and updating property values.  Most PropertyEditors will
 only need to support a subset of the different options available in
 this API.
 <P>
 Simple PropertyEditors may only support the getAsText and setAsText
 methods and need not support (say) paintValue or getCustomEditor.  More
 complex types may be unable to support getAsText and setAsText but will
 instead support paintValue and getCustomEditor.
 <p>
 Every propertyEditor must support one or more of the three simple
 display styles.  Thus it can either (1) support isPaintable or (2)
 both return a non-null String[] from getTags() and return a non-null
 value from getAsText or (3) simply return a non-null String from 
 getAsText().
 <p>
 Every property editor must support a call on setValue when the argument
 object is of the type for which this is the corresponding propertyEditor.
 In addition, each property editor must either support a custom editor,
 or support setAsText.
 <p>
 Each PropertyEditor should have a null constructor.
<p>
<hr>
<a name="index"></a>
<h2>
  <img src="images/method-index.gif" width=207 height=38 alt="Method Index">
</h2>
<dl>
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#addPropertyChangeListener(java.beans.PropertyChangeListener)"><b>addPropertyChangeListener</b></a>(PropertyChangeListener)
  <dd>  Register a listener for the PropertyChange event.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#getAsText()"><b>getAsText</b></a>()
  <dd>  
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#getCustomEditor()"><b>getCustomEditor</b></a>()
  <dd>  A PropertyEditor may choose to make available a full custom Component
 that edits its property value.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#getJavaInitializationString()"><b>getJavaInitializationString</b></a>()
  <dd>  This method is intended for use when generating Java code to set
 the value of the property.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#getTags()"><b>getTags</b></a>()
  <dd>  If the property value must be one of a set of known tagged values, 
 then this method should return an array of the tags.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#getValue()"><b>getValue</b></a>()
  <dd>  
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#isPaintable()"><b>isPaintable</b></a>()
  <dd>  
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#paintValue(java.awt.Graphics, java.awt.Rectangle)"><b>paintValue</b></a>(Graphics, Rectangle)
  <dd>  Paint a representation of the value into a given area of screen
 real estate.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#removePropertyChangeListener(java.beans.PropertyChangeListener)"><b>removePropertyChangeListener</b></a>(PropertyChangeListener)
  <dd>  Remove a listener for the PropertyChange event.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#setAsText(java.lang.String)"><b>setAsText</b></a>(String)
  <dd>  Set the property value by parsing a given String.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#setValue(java.lang.Object)"><b>setValue</b></a>(Object)
  <dd>  Set (or change) the object that is to be edited.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#supportsCustomEditor()"><b>supportsCustomEditor</b></a>()
  <dd>  
</dl>
<a name="methods"></a>
<h2>
  <img src="images/methods.gif" width=151 height=38 alt="Methods">
</h2>
<a name="setValue(java.lang.Object)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="setValue"><b>setValue</b></a>
<pre>
 public abstract void setValue(<a href="java.lang.Object.html#_top_">Object</a> value)
</pre>
<dl>
  <dd> Set (or change) the object that is to be edited.  Builtin types such
 as "int" must be wrapped as the corresponding object type such as
 "java.lang.Integer".
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> value - The new target object to be edited.  Note that this
     object should not be modified by the PropertyEditor, rather 
     the PropertyEditor should create a new object to hold any
     modified value.
  </dl></dd>
</dl>
<a name="getValue()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="getValue"><b>getValue</b></a>
<pre>
 public abstract <a href="java.lang.Object.html#_top_">Object</a> getValue()
</pre>
<dl>
  <dd><dl>
    <dt> <b>Returns:</b>
    <dd> The value of the property.  Builtin types such as "int" will
 be wrapped as the corresponding object type such as "java.lang.Integer".
  </dl></dd>
</dl>
<a name="isPaintable()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="isPaintable"><b>isPaintable</b></a>
<pre>
 public abstract boolean isPaintable()
</pre>
<dl>
  <dd><dl>
    <dt> <b>Returns:</b>
    <dd> True if the class will honor the paintValue method.
  </dl></dd>
</dl>
<a name="paintValue(java.awt.Graphics, java.awt.Rectangle)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="paintValue"><b>paintValue</b></a>
<pre>
 public abstract void paintValue(<a href="java.awt.Graphics.html#_top_">Graphics</a> gfx,
                                 <a href="java.awt.Rectangle.html#_top_">Rectangle</a> box)
</pre>
<dl>
  <dd> Paint a representation of the value into a given area of screen
 real estate.  Note that the propertyEditor is responsible for doing
 its own clipping so that it fits into the given rectangle.
 <p>
 If the PropertyEditor doesn't honor paint requests (see isPaintable)
 this method should be a silent noop.
 <p>
 The given Graphics object will have the default font, color, etc of
 the parent container.  The PropertyEditor may change graphics attributes
 such as font and color and doesn't need to restore the old values.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> gfx - Graphics object to paint into.
    <dd> box - Rectangle within graphics object into which we should paint.
  </dl></dd>
</dl>
<a name="getJavaInitializationString()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="getJavaInitializationString"><b>getJavaInitializationString</b></a>
<pre>
 public abstract <a href="java.lang.String.html#_top_">String</a> getJavaInitializationString()
</pre>
<dl>
  <dd> This method is intended for use when generating Java code to set
 the value of the property.  It should return a fragment of Java code
 that can be used to initialize a variable with the current property
 value.
 <p>
 Example results are "2", "new Color(127,127,34)", "Color.orange", etc.
<p>
  <dd><dl>
    <dt> <b>Returns:</b>
    <dd> A fragment of Java code representing an initializer for the
   	current value.
  </dl></dd>
</dl>
<a name="getAsText()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="getAsText"><b>getAsText</b></a>
<pre>
 public abstract <a href="java.lang.String.html#_top_">String</a> getAsText()
</pre>
<dl>
  <dd><dl>
    <dt> <b>Returns:</b>
    <dd> The property value as a human editable string.
 <p>   Returns null if the value can't be expressed as an editable string.
 <p>   If a non-null value is returned, then the PropertyEditor should
	     be prepared to parse that string back in setAsText().
  </dl></dd>
</dl>
<a name="setAsText(java.lang.String)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="setAsText"><b>setAsText</b></a>
<pre>
 public abstract void setAsText(<a href="java.lang.String.html#_top_">String</a> text) throws <a href="java.lang.IllegalArgumentException.html#_top_">IllegalArgumentException</a>
</pre>
<dl>
  <dd> Set the property value by parsing a given String.  May raise
 java.lang.IllegalArgumentException if either the String is
 badly formatted or if this kind of property can't be expressed
 as text.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> text - The string to be parsed.
  </dl></dd>
</dl>
<a name="getTags()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="getTags"><b>getTags</b></a>
<pre>
 public abstract <a href="java.lang.String.html#_top_">String</a>[] getTags()
</pre>
<dl>
  <dd> If the property value must be one of a set of known tagged values, 
 then this method should return an array of the tags.  This can
 be used to represent (for example) enum values.  If a PropertyEditor
 supports tags, then it should support the use of setAsText with
 a tag value as a way of setting the value and the use of getAsText
 to identify the current value.
<p>
  <dd><dl>
    <dt> <b>Returns:</b>
    <dd> The tag values for this property.  May be null if this
   property cannot be represented as a tagged value.
  </dl></dd>
</dl>
<a name="getCustomEditor()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="getCustomEditor"><b>getCustomEditor</b></a>
<pre>
 public abstract <a href="java.awt.Component.html#_top_">Component</a> getCustomEditor()
</pre>
<dl>
  <dd> A PropertyEditor may choose to make available a full custom Component
 that edits its property value.  It is the responsibility of the
 PropertyEditor to hook itself up to its editor Component itself and
 to report property value changes by firing a PropertyChange event.
 <P>
 The higher-level code that calls getCustomEditor may either embed
 the Component in some larger property sheet, or it may put it in
 its own individual dialog, or ...
<p>
  <dd><dl>
    <dt> <b>Returns:</b>
    <dd> A java.awt.Component that will allow a human to directly
      edit the current property value.  May be null if this is
	    not supported.
  </dl></dd>
</dl>
<a name="supportsCustomEditor()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="supportsCustomEditor"><b>supportsCustomEditor</b></a>
<pre>
 public abstract boolean supportsCustomEditor()
</pre>
<dl>
  <dd><dl>
    <dt> <b>Returns:</b>
    <dd> True if the propertyEditor can provide a custom editor.
  </dl></dd>
</dl>
<a name="addPropertyChangeListener(java.beans.PropertyChangeListener)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="addPropertyChangeListener"><b>addPropertyChangeListener</b></a>
<pre>
 public abstract void addPropertyChangeListener(<a href="java.beans.PropertyChangeListener.html#_top_">PropertyChangeListener</a> listener)
</pre>
<dl>
  <dd> Register a listener for the PropertyChange event.  When a
 PropertyEditor changes its value it should fire a PropertyChange
 event on all registered PropertyChangeListeners, specifying the
 null value for the property name and itself as the source.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> listener - An object to be invoked when a PropertyChange
		event is fired.
  </dl></dd>
</dl>
<a name="removePropertyChangeListener(java.beans.PropertyChangeListener)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="removePropertyChangeListener"><b>removePropertyChangeListener</b></a>
<pre>
 public abstract void removePropertyChangeListener(<a href="java.beans.PropertyChangeListener.html#_top_">PropertyChangeListener</a> listener)
</pre>
<dl>
  <dd> Remove a listener for the PropertyChange event.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> listener - The PropertyChange listener to be removed.
  </dl></dd>
</dl>
<hr>
<pre>
<a href="packages.html">All Packages</a>  <a href="tree.html">Class Hierarchy</a>  <a href="Package-java.beans.html">This Package</a>  <a href="java.beans.PropertyChangeListener.html#_top_">Previous</a>  <a href="java.beans.VetoableChangeListener.html#_top_">Next</a>  <a href="AllNames.html">Index</a></pre>
</body>
</html>
