org.netbeans.core/2 3.32

org.netbeans.beaninfo.editors
Class CharEditor

java.lang.Object
  extended by java.beans.PropertyEditorSupport
      extended by org.netbeans.beaninfo.editors.CharEditor
All Implemented Interfaces:
PropertyEditor, EnhancedPropertyEditor

public class CharEditor
extends PropertyEditorSupport
implements EnhancedPropertyEditor

Editor for Character.TYPE


Constructor Summary
CharEditor()
           
 
Method Summary
 String getAsText()
          Converts the char to String by either leaving the single char or by creating unicode escape.
 Component getInPlaceCustomEditor()
          We don't support in place custom editor.
 String getJavaInitializationString()
          This method is intended for use when generating Java code to set the value of the property.
 boolean hasInPlaceCustomEditor()
          We don't support in place custom editor.
 void setAsText(String text)
          Set the property value by parsing given String.
 void setValue(Object newValue)
          Accepts Character and String values.
 boolean supportsEditingTaggedValues()
           
 
Methods inherited from class java.beans.PropertyEditorSupport
addPropertyChangeListener, firePropertyChange, getCustomEditor, getSource, getTags, getValue, isPaintable, paintValue, removePropertyChangeListener, setSource, supportsCustomEditor
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.beans.PropertyEditor
addPropertyChangeListener, getCustomEditor, getTags, getValue, isPaintable, paintValue, removePropertyChangeListener, supportsCustomEditor
 

Constructor Detail

CharEditor

public CharEditor()
Method Detail

getAsText

public String getAsText()
Converts the char to String by either leaving the single char or by creating unicode escape.

Specified by:
getAsText in interface PropertyEditor
Overrides:
getAsText in class PropertyEditorSupport

setAsText

public void setAsText(String text)
               throws IllegalArgumentException
Set the property value by parsing given String.

Specified by:
setAsText in interface PropertyEditor
Overrides:
setAsText in class PropertyEditorSupport
Parameters:
text - The string to be parsed.
Throws:
IllegalArgumentException

setValue

public void setValue(Object newValue)
              throws IllegalArgumentException
Accepts Character and String values. If the argument is a String the first character is taken as the new value.

Specified by:
setValue in interface PropertyEditor
Overrides:
setValue in class PropertyEditorSupport
Parameters:
v - new value
Throws:
IllegalArgumentException

getJavaInitializationString

public String getJavaInitializationString()
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.

Example results are "2", "new Color(127,127,34)", "Color.orange", etc.

Specified by:
getJavaInitializationString in interface PropertyEditor
Overrides:
getJavaInitializationString in class PropertyEditorSupport
Returns:
A fragment of Java code representing an initializer for the current value.

getInPlaceCustomEditor

public Component getInPlaceCustomEditor()
We don't support in place custom editor.

Specified by:
getInPlaceCustomEditor in interface EnhancedPropertyEditor
Returns:
custom property editor to be shown inside the property sheet.

hasInPlaceCustomEditor

public boolean hasInPlaceCustomEditor()
We don't support in place custom editor.

Specified by:
hasInPlaceCustomEditor in interface EnhancedPropertyEditor
Returns:
true if this PropertyEditor provides a enhanced in-place custom property editor, false otherwise

supportsEditingTaggedValues

public boolean supportsEditingTaggedValues()
Specified by:
supportsEditingTaggedValues in interface EnhancedPropertyEditor
Returns:
true if this property editor provides tagged values and a custom strings in the choice should be accepted too, false otherwise

org.netbeans.core/2 3.32

Built on May 22 2012.  |  Portions Copyright 1997-2012 Oracle. All rights reserved.