net.javaprog.ui.wizard
Class DefaultDataLookup
java.lang.Object
net.javaprog.ui.wizard.DefaultDataLookup
- All Implemented Interfaces:
- DataLookup
- public class DefaultDataLookup
- extends Object
- implements DataLookup
Default implementation for DataLookup using reflection. This is how
you would register a text field with a data model using this default
implementation:
DataModel dataModel;
JTextField textField;
...
Method method = null;
try {
method = textField.getClass().getMethod("getText", null);
} catch (NoSuchMethodException nsme) {}
DataLookup dataLookup = new DefaultDataLookup(textField, method, null);
dataModel.registerDataLookup("MyTextField", dataLookup);
- See Also:
DataModel
|
Constructor Summary |
DefaultDataLookup(Object object,
Method lookupMethod,
Object[] parameterList)
Creates a new data lookup mechanism using the given method on
the specified object passing the given parameters. |
|
Method Summary |
Object |
lookupData()
Returns the value of the data source this object is registered with. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
lookupMethod
protected Method lookupMethod
parameterList
protected Object[] parameterList
object
protected Object object
DefaultDataLookup
public DefaultDataLookup(Object object,
Method lookupMethod,
Object[] parameterList)
- Creates a new data lookup mechanism using the given method on
the specified object passing the given parameters.
lookupData
public Object lookupData()
- Description copied from interface:
DataLookup
- Returns the value of the data source this object is registered with.
- Specified by:
lookupData in interface DataLookup