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

Field Summary
protected  Method lookupMethod
           
protected  Object object
           
protected  Object[] parameterList
           
 
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
 

Field Detail

lookupMethod

protected Method lookupMethod

object

protected Object object

parameterList

protected Object[] parameterList
Constructor Detail

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.

Method Detail

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