|
SPT Core API | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.sptci.echo2.binding.Updater<V,M>
com.sptci.echo2.binding.ViewUpdater<V,M>
V - The class of the view component being updated.M - The class of the model object from which to update.public class ViewUpdater<V,M>
An updater used to update UI components with data from
their backing model objects.
Copyright 2006 Sans Pareil Technologies, Inc.
| Field Summary |
|---|
| Fields inherited from class com.sptci.echo2.binding.Updater |
|---|
bean, logger, view |
| Constructor Summary | |
|---|---|
ViewUpdater(V view,
M bean)
Create a new instance with the specified UI container and java bean. |
|
| Method Summary | |
|---|---|
DefaultMutableTreeNode |
createChild(Treeable treeable)
Create tree nodes that represent the Treeable
object and its children. |
Object |
createRootUserObject(String name)
Create the userObject for a root tree node. |
Object |
createUserObject(Treeable t)
Create the userObject for a tree node. |
protected void |
processMap(Map<String,ToggleButton> ui,
Map<String,Boolean> value)
Update ToggleButton UI components. |
void |
update()
Update the fields of the Updater.view with the data in
similarly named fields in Updater.bean. |
void |
update(String baseProperty)
Update the Updater.view component with data in the specified
Updater.bean. |
protected void |
updateComponent(Object object,
Object value)
Update the value of the specified code using the specified value. |
protected void |
updateListBox(ListBox listBox,
Collection values)
Update a ListBox UI component. |
protected void |
updateSelectField(SelectField selectField,
Object object)
Update a SelectField UI component. |
protected void |
updateTextComponent(TextComponent component,
Object value)
Update text compnents with the value specified. |
void |
updateTree(Tree tree,
Collection<Treeable> collection,
String baseProperty)
Update a Tree with the data in the specified collection. |
protected void |
updateView(View view,
Object value)
Update a View component. |
| Methods inherited from class com.sptci.echo2.binding.Updater |
|---|
beanValues, getBean, getView, setBean, setView, viewValues |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ViewUpdater(V view,
M bean)
view - The Updater.view to use.bean - The Updater.bean to use.| Method Detail |
|---|
public void update()
Updater.view with the data in
similarly named fields in Updater.bean.
update in class Updater<V,M>BindingException - If errors are encountered while
accessing or setting the fields.ReflectionUtility.fetchField(java.lang.String, java.lang.Object),
updateComponent(java.lang.Object, java.lang.Object)public void update(String baseProperty)
Updater.view component with data in the specified
Updater.bean. This method should be used to update special
components such as tables, trees etc.
baseProperty - The base property used to fetch localised string
values. This should include the fully qualified name of the
container class as well as the field.
protected void updateComponent(Object object,
Object value)
object - The UI component that is to be updated.value - The value with which to update the object.updateTextComponent(nextapp.echo2.app.text.TextComponent, java.lang.Object),
processMap(java.util.Map, java.util.Map) ,
updateSelectField(nextapp.echo2.app.SelectField, java.lang.Object),
updateListBox(nextapp.echo2.app.ListBox, java.util.Collection)
protected void updateTextComponent(TextComponent component,
Object value)
component - The text component that is to be updated.value - The value to set in the text component.
protected void processMap(Map<String,ToggleButton> ui,
Map<String,Boolean> value)
ToggleButton UI components.
ui - The map that contains the name and selected state
of the toggle button.value - The new mappings to apply to the UI component.
protected void updateListBox(ListBox listBox,
Collection values)
ListBox UI component.
listBox - The ListBox UI component that is to be updated.values - The updated collection of selected data to apply to the
list box component.
protected void updateSelectField(SelectField selectField,
Object object)
SelectField UI component.
selectField - The UI component that is to be updated.object - The object that is to be set as selected in the list.
protected void updateView(View view,
Object value)
View component. Look for a field
named model and try to set the value of that field.
view - The view component to update.value - The value to set for the model backing the view.
public void updateTree(Tree tree,
Collection<Treeable> collection,
String baseProperty)
Tree with the data in the specified collection.
tree - The tree to be updated.collection - The collection of Treeable
instances.baseProperty - The base name to use to look up localised values.createUserObject(com.sptci.jdo.Treeable),
createChild(com.sptci.jdo.Treeable)public DefaultMutableTreeNode createChild(Treeable treeable)
Treeable
object and its children.
treeable - The object for which a corresponding tree node is
to be created.
createUserObject(com.sptci.jdo.Treeable)public Object createRootUserObject(String name)
userObject for a root tree node. The user
object is different for a general tree from an EditableTree.
name - The title to set for the user object.
public Object createUserObject(Treeable t)
userObject for a tree node. The user object
is different for a general tree from an EditableTree.
t - The treeable model object to use as the user object.
|
SPT Core API | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||