|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectewe.data.DataObject
ewe.data.LiveObject
This is a complete implementation of LiveData which you can use as a base for creating new LiveData Objects.
| Constructor Summary | |
LiveObject()
|
|
| Method Summary | |
void |
action(FieldTransfer ft,
Editor ed)
This implements the action() method in FieldListener. |
void |
action(String fieldName,
Editor ed)
This gets called by action(FieldTransfer ft,Editor ed) and by fieldChanged(FieldTransfer ft,Editor ed) if the field changed is a menu item. |
protected UIBuilder |
addMeToPanel(CellPanel cp,
Editor ed,
String baseClassName)
Use this within addToPanel() if you still want it's default of creating a new UIBuilder and adding an InputStack. |
static UIBuilder |
addObjectToPanel(CellPanel cp,
Editor ed,
Object objectOrClass,
boolean declaredOnly)
This works on any object. |
void |
addToPanel(CellPanel cp,
Editor ed,
int options)
Override this to provide the user interface for editing the Object. |
protected TextDecoder |
decode(TextDecoder td)
Override this to decode the fields that you want to decode. |
protected void |
decoded(String from)
This method is called after the base implementation of textDecode() is executed. |
TextDecoder |
decodeFields(String fieldNames,
TextDecoder td,
String baseName)
You can call this within your decode(TextDecoder te) method to encode specific fields. |
static void |
enableEditorScrolling(Editor ed,
boolean enable)
Enable/Disable an Editors main scrollbar panel. |
protected TextEncoder |
encode(TextEncoder te)
Override this to encode the fields that you want to encode. |
protected String |
encoded(String to)
This method is called after the base implementation of textEncode() is executed. |
TextEncoder |
encodeFields(String fieldNames,
TextEncoder te,
String baseName)
You can call this within your encode(TextEncoder te) method to encode specific fields. |
void |
fieldChanged(FieldTransfer ft,
Editor ed)
This implements the fieldChanged() method in FieldListener. |
void |
fieldChanged(String fieldName,
Editor ed)
This gets called by fieldChanged(FieldTransfer ft,Editor ed). |
void |
fieldEvent(FieldTransfer ft,
Editor ed,
Object event)
This implements the fieldEvent() method in FieldListener. |
Editor |
getEditor(int options)
This creates a new Editor Object - you should not override this method, rather you should override the addToPanel() method to provide a custom Editor for your LiveData. |
protected ScrollablePanel |
getEditorScroller(CellPanel cp)
This is called by the default getEditor() should return a ScrollBarPanel for the CellPanel that the editor is being placed in. |
IImage |
getIcon()
This returns null by default. |
String |
getName()
By default this returns the String "unnamed". |
boolean |
input(String title,
int editorOption)
This opens an Editor for this object. |
protected Editor |
makeNewEditor(int options)
This shoudl create the new Editor object but not add anything to it. |
Form |
runAsApp()
Get a Form to run this LiveObject as a stand-alone application. |
void |
textDecode(String txt)
You can override this to decode a String representation of the Object as encoded by textEncode, but it is easier to override decode(TextDecoder te). |
String |
textEncode()
You can override this to encode the object as a String, but it is easier to override encode(TextEncoder te). |
| Methods inherited from class ewe.data.DataObject |
_getSetField, appendAllFields, compareTo, copied, copyFrom, equals, getCopy, getDeclaredField, getDeclaredFieldValue, getDeclaredFieldValue, getFieldList, getFieldList, getMyFieldList, getNew |
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, hashCode, toString |
| Methods inherited from interface ewe.data.DataUnit |
copyFrom, getNew |
| Methods inherited from interface ewe.util.Copyable |
getCopy |
| Methods inherited from interface ewe.util.Comparable |
compareTo |
| Constructor Detail |
public LiveObject()
| Method Detail |
public String getName()
getName in interface LiveDataprotected Editor makeNewEditor(int options)
protected ScrollablePanel getEditorScroller(CellPanel cp)
You may return null from this.
public Editor getEditor(int options)
getEditor in interface LiveData
public static void enableEditorScrolling(Editor ed,
boolean enable)
By default, the getEditor() method will place a CellPanel into a ScrollBarPanel and then add it the Editor before calling addToPanel(). However initially this ScrollBarPanel is disabled (i.e. it's "shrinkComponent" variable is true - which results in ScrollBars never appearing). This method is used to enable it.
ed - The editor created by getEditor().enable - true to enable scrolling, false to disable it.
public void action(String fieldName,
Editor ed)
public void fieldChanged(String fieldName,
Editor ed)
public void action(FieldTransfer ft,
Editor ed)
action in interface FieldListenerft - The FieldTransfer object representing the changed field.ed - The Editor from which the event came.
public void fieldChanged(FieldTransfer ft,
Editor ed)
If the field is of type ewe.ui.MenuItem then the method action(String name,Editor ed) is called with the "name" parameter being set to the "action" member of the selected MenuItem.
Otherwise the fieldChanged(String fieldName,Editor ed) method is called with the fieldName of the FieldTransfer object.
fieldChanged in interface FieldListenerft - The FieldTransfer object representing the changed field.ed - The Editor from which the event came.
public void fieldEvent(FieldTransfer ft,
Editor ed,
Object event)
fieldEvent in interface FieldListener
public void addToPanel(CellPanel cp,
Editor ed,
int options)
protected UIBuilder addMeToPanel(CellPanel cp,
Editor ed,
String baseClassName)
throws IllegalArgumentException
cp - The CellPanel passed to addToPanel()ed - The Editor passed to addToPanel()baseClassName - The base class being added.
IllegalArgumentException - if the baseClassName is not valid for this object.public String textEncode()
textEncode in interface LiveDatapublic void textDecode(String txt)
textDecode in interface LiveData
public TextEncoder encodeFields(String fieldNames,
TextEncoder te,
String baseName)
fieldNames - A comma separated list of field names.te - A TextEncoder object.baseName - Either the fully qualified class and package name or the class name (without package) of the object.
public TextDecoder decodeFields(String fieldNames,
TextDecoder td,
String baseName)
fieldNames - A comma separated list of field names.td - A TextDecoder object.baseName - Either the fully qualified class and package name or the class name (without package) of the object.
public IImage getIcon()
getIcon in interface LiveDataprotected TextEncoder encode(TextEncoder te)
protected TextDecoder decode(TextDecoder td)
public boolean input(String title,
int editorOption)
title - The title for the editor. Can be null to leave as is.editorOption - Options to pass to getEditor().
protected void decoded(String from)
from - The String this object was decoded from.protected String encoded(String to)
to - the String the object has been encoded to.
public static UIBuilder addObjectToPanel(CellPanel cp,
Editor ed,
Object objectOrClass,
boolean declaredOnly)
throws IllegalArgumentException
cp - A CellPanel to add the object fields to.ed - The Editor to be used to edit the object.objectOrClass - The object or the Class/Reflect of the object.declaredOnly - if this is true then only the declared fields will be added
and not the fields of the superclass.
IllegalArgumentExceptionpublic Form runAsApp()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||