Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

com.sunwheeltech.sirius.support
Class GenericDialogPropertyEditor  view GenericDialogPropertyEditor download GenericDialogPropertyEditor.java

java.lang.Object
  extended bycom.sunwheeltech.sirius.support.GenericDialogPropertyEditor
All Implemented Interfaces:
java.beans.PropertyEditor
Direct Known Subclasses:
FilePropertyEditor, ResourceURLPropertyEditor

public class GenericDialogPropertyEditor
extends java.lang.Object
implements java.beans.PropertyEditor

Generic property editor where the property value is selected by browsing an Uncle Unc item tree.


Field Summary
(package private)  dog.gui.DButton button
          button used to launch browser
(package private)  ulu.view.ui.sirius.SDialog dialog
          dialog panel to use as a custom editor
(package private)  dog.gui.DTextField fld
          text widget showing current value of the object being browsed
(package private)  dog.gui.DContainer inline
          panel to show the state of the property inline, as a text box and a button that launches a browser dialog
protected  java.util.Vector listeners
          list of property change listeners to be notified of property updates
static java.lang.String NULL_VALUE_LABEL
          display name to use for a null value
(package private)  ulu.view.View root
          root view of the item tree to be browsed by the dialog
(package private)  java.lang.Object value
          value being edited
 
Constructor Summary
GenericDialogPropertyEditor()
          constructor sets up the dialog component
 
Method Summary
 void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
          add a listener to notify of property changes
 void firePropertyChange(java.lang.Object oldv, java.lang.Object newv)
          fire update event to all listeners
 java.lang.String getAsText()
          Gets the property value as a string suitable for presentation to a human to edit.
 java.awt.Component getCustomEditor()
          get the custom editor component
 java.lang.String getJavaInitializationString()
          get scrapof java code used to initialise the bean
 ulu.view.View getRoot()
          get the root view shown by the dialog
 java.lang.String[] getTags()
          get list of accepted values for this bean property
 java.lang.Object getValue()
          get the value of the property.
 boolean isPaintable()
          whether can paint a representation of current value
 void makeGUI()
          make the gui components, with options to make the textbox editable, show a dialog launcher, etc.
 void paintValue(java.awt.Graphics g, java.awt.Rectangle box)
          Paint a representation of the value into a given area of screen
 java.lang.Object parseDialogResult(java.lang.Object obj)
          no-op implementation of a method that parses the Item returned by the dialog
 java.lang.Object parseTextInput(java.lang.String str)
          no-op implementation of a method that checks a string (usually text typed into the text box) and assesses its validity
 void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
          remove a listener
 void revertText()
          revert the text input field to previous sensible value, or bring up an error message, or somehow indicate that the text entered wasn't correct.
 void setAsText(java.lang.String str)
          Sets the property value by parsing a given String.
 void setRoot(ulu.view.View v)
          set the root view shown by the dialog
 void setValue(java.lang.Object obj)
          set the object to be edited
 boolean supportsCustomEditor()
          indicate whether a custom editor component is supported, which it is in this case
protected  void syncDialogToText()
          match dialog value to text input, as the text has just been altered.
protected  void syncTextToDialog()
          match text input data to dialog value, as the dialog has just returned
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NULL_VALUE_LABEL

public static final java.lang.String NULL_VALUE_LABEL
display name to use for a null value

See Also:
Constant Field Values

root

ulu.view.View root
root view of the item tree to be browsed by the dialog


inline

dog.gui.DContainer inline
panel to show the state of the property inline, as a text box and a button that launches a browser dialog


fld

dog.gui.DTextField fld
text widget showing current value of the object being browsed


button

dog.gui.DButton button
button used to launch browser


dialog

ulu.view.ui.sirius.SDialog dialog
dialog panel to use as a custom editor


value

java.lang.Object value
value being edited


listeners

protected java.util.Vector listeners
list of property change listeners to be notified of property updates

Constructor Detail

GenericDialogPropertyEditor

public GenericDialogPropertyEditor()
constructor sets up the dialog component

Method Detail

getRoot

public ulu.view.View getRoot()
get the root view shown by the dialog


setRoot

public void setRoot(ulu.view.View v)
set the root view shown by the dialog


makeGUI

public void makeGUI()
make the gui components, with options to make the textbox editable, show a dialog launcher, etc. Override this method to add filters, preview panes etc. to the dialog, and so on


syncTextToDialog

protected void syncTextToDialog()
match text input data to dialog value, as the dialog has just returned


syncDialogToText

protected void syncDialogToText()
match dialog value to text input, as the text has just been altered. No-op implementation, may be overridden


parseTextInput

public java.lang.Object parseTextInput(java.lang.String str)
no-op implementation of a method that checks a string (usually text typed into the text box) and assesses its validity


parseDialogResult

public java.lang.Object parseDialogResult(java.lang.Object obj)
no-op implementation of a method that parses the Item returned by the dialog


revertText

public void revertText()
revert the text input field to previous sensible value, or bring up an error message, or somehow indicate that the text entered wasn't correct. By default, will revert to last good value


getValue

public java.lang.Object getValue()
get the value of the property.

Specified by:
getValue in interface java.beans.PropertyEditor

setValue

public void setValue(java.lang.Object obj)
set the object to be edited

Specified by:
setValue in interface java.beans.PropertyEditor

supportsCustomEditor

public boolean supportsCustomEditor()
indicate whether a custom editor component is supported, which it is in this case

Specified by:
supportsCustomEditor in interface java.beans.PropertyEditor

getCustomEditor

public java.awt.Component getCustomEditor()
get the custom editor component

Specified by:
getCustomEditor in interface java.beans.PropertyEditor

isPaintable

public boolean isPaintable()
whether can paint a representation of current value

Specified by:
isPaintable in interface java.beans.PropertyEditor

paintValue

public void paintValue(java.awt.Graphics g,
                       java.awt.Rectangle box)
Paint a representation of the value into a given area of screen

Specified by:
paintValue in interface java.beans.PropertyEditor

getJavaInitializationString

public java.lang.String getJavaInitializationString()
get scrapof java code used to initialise the bean

Specified by:
getJavaInitializationString in interface java.beans.PropertyEditor

getAsText

public java.lang.String getAsText()
Gets the property value as a string suitable for presentation to a human to edit.

Specified by:
getAsText in interface java.beans.PropertyEditor

setAsText

public void setAsText(java.lang.String str)
               throws java.lang.IllegalArgumentException
Sets the property value by parsing a given String.

Specified by:
setAsText in interface java.beans.PropertyEditor

getTags

public java.lang.String[] getTags()
get list of accepted values for this bean property

Specified by:
getTags in interface java.beans.PropertyEditor

addPropertyChangeListener

public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
add a listener to notify of property changes

Specified by:
addPropertyChangeListener in interface java.beans.PropertyEditor

removePropertyChangeListener

public void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
remove a listener

Specified by:
removePropertyChangeListener in interface java.beans.PropertyEditor

firePropertyChange

public void firePropertyChange(java.lang.Object oldv,
                               java.lang.Object newv)
fire update event to all listeners