|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectse.datadosen.util.MapBinder
public class MapBinder
Utility class for synchronizing a Swing GUI with a Map object. Synchronization is
performed when calling getMap() and syncUI(). Matching is done where the name of a
map key corresponds to the name of a GUI element. Currently handles JText components,
JCheckBox, JComboBox and JColorSelector
This is a successor to PropertyBinder that keeps the datatypes of component values
instead of converting all to strings like PropertyBinder does
Copyright (c) 2003, David Ekholm Datadosen
| Nested Class Summary | |
|---|---|
static interface |
MapBinder.ComponentBinder
Add support for other component types |
| Constructor Summary | |
|---|---|
MapBinder()
|
|
| Method Summary | |
|---|---|
static java.util.Map<java.lang.String,java.lang.Object> |
getMap(JComponentHolder jComponentHolder)
Read properties from a UI. |
static java.util.Map<java.lang.String,java.lang.Object> |
getMap(JComponentHolder jComponentHolder,
java.util.Map<java.lang.String,java.lang.Object> existing)
Read properties from a UI. |
static MapBinder.ComponentBinder |
registerComponentBinder(java.lang.Class componentClass,
MapBinder.ComponentBinder binder)
Add support for other component types (subclasses of JComponent) |
static void |
syncUI(java.util.Map<java.lang.String,java.lang.Object> props,
JComponentHolder jComponentHolder)
Update a UI from a Map object. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public MapBinder()
| Method Detail |
|---|
public static java.util.Map<java.lang.String,java.lang.Object> getMap(JComponentHolder jComponentHolder)
jComponentHolder - object containing Swing type member variables/components
public static java.util.Map<java.lang.String,java.lang.Object> getMap(JComponentHolder jComponentHolder,
java.util.Map<java.lang.String,java.lang.Object> existing)
jComponentHolder - object containing Swing type member variables/componentsexisting - Properties object to add properties to
java.lang.RuntimeException
public static void syncUI(java.util.Map<java.lang.String,java.lang.Object> props,
JComponentHolder jComponentHolder)
props - Properties to pass to UIjComponentHolder - object containing Swing type member variables/components to be
synchronized.
java.lang.RuntimeException
public static MapBinder.ComponentBinder registerComponentBinder(java.lang.Class componentClass,
MapBinder.ComponentBinder binder)
componentClass - handler -
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||