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

Quick Search    Search Deep

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

java.lang.Object
  extended bycom.sunwheeltech.sirius.support.GenericDialogPropertyEditor
      extended bycom.sunwheeltech.sirius.support.ResourceURLPropertyEditor
All Implemented Interfaces:
java.beans.PropertyEditor

public class ResourceURLPropertyEditor
extends GenericDialogPropertyEditor

Property editor for resource URLs with a popup dialog for browsing filesystem or text input (e.g. to allow http, ftp urls)


Field Summary
(package private)  java.net.URL url
          URL of the resource property being edited
 
Fields inherited from class com.sunwheeltech.sirius.support.GenericDialogPropertyEditor
button, dialog, fld, inline, listeners, NULL_VALUE_LABEL, root, value
 
Constructor Summary
ResourceURLPropertyEditor()
           
 
Method Summary
 java.lang.String getAsText()
          retrieve valid text representation of current value of the field.
 java.lang.String getJavaInitializationString()
          get the code that will initialise the value
 java.lang.Object getValue()
          get the value of the property being edited
 void makeGUI()
          customise the dialog for browsing files etc.
 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)
          set the value of the property from the text input - try to create a url from the text.
 void setValue(java.lang.Object obj)
          set the value of the property being edited
protected  void syncDialogToText()
          match dialog value to text input, as the text has just been altered.
 
Methods inherited from class com.sunwheeltech.sirius.support.GenericDialogPropertyEditor
addPropertyChangeListener, firePropertyChange, getCustomEditor, getRoot, getTags, isPaintable, paintValue, removePropertyChangeListener, revertText, setAsText, setRoot, supportsCustomEditor, syncTextToDialog
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

url

java.net.URL url
URL of the resource property being edited

Constructor Detail

ResourceURLPropertyEditor

public ResourceURLPropertyEditor()
Method Detail

getValue

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

Specified by:
getValue in interface java.beans.PropertyEditor
Overrides:
getValue in class GenericDialogPropertyEditor

setValue

public void setValue(java.lang.Object obj)
set the value of the property being edited

Specified by:
setValue in interface java.beans.PropertyEditor
Overrides:
setValue in class GenericDialogPropertyEditor

makeGUI

public void makeGUI()
customise the dialog for browsing files etc.

Overrides:
makeGUI in class GenericDialogPropertyEditor

getAsText

public java.lang.String getAsText()
retrieve valid text representation of current value of the field. By default, returns the toString() of the current view's referred object, or "null" if empty

Specified by:
getAsText in interface java.beans.PropertyEditor
Overrides:
getAsText in class GenericDialogPropertyEditor

parseTextInput

public java.lang.Object parseTextInput(java.lang.String str)
set the value of the property from the text input - try to create a url from the text. (It only checks for well-formedness of the URL, doesn't try to connect to it)

Overrides:
parseTextInput in class GenericDialogPropertyEditor

parseDialogResult

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

Overrides:
parseDialogResult in class GenericDialogPropertyEditor

syncDialogToText

protected void syncDialogToText()
match dialog value to text input, as the text has just been altered. See if the url is file or zip or jar-class protocol, and try to set the dialog to point to that item's parent folder

Overrides:
syncDialogToText in class GenericDialogPropertyEditor

getJavaInitializationString

public java.lang.String getJavaInitializationString()
get the code that will initialise the value

Specified by:
getJavaInitializationString in interface java.beans.PropertyEditor
Overrides:
getJavaInitializationString in class GenericDialogPropertyEditor