|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jdesktop.dataset.DataProvider
public abstract class DataProvider
Provides a basic implementation of DataProvider that handles all of the threading issues normally associated with writing a DataProvider.
Constructor Summary | |
---|---|
DataProvider()
|
Method Summary | |
---|---|
void |
addPropertyChangeListener(java.beans.PropertyChangeListener listener)
Adds a PropertyChangeListener to this class for any changes to bean properties. |
void |
addPropertyChangeListener(java.lang.String propertyName,
java.beans.PropertyChangeListener listener)
Adds a PropertyChangeListener to this class for specific property changes. |
protected abstract LoadTask |
createLoadTask(DataTable[] tables)
Creates a Task that loads data from the data store into one or more DataTables. |
protected abstract SaveTask |
createSaveTask(DataTable[] tables)
Creates a task that saves data from an array of DataTables to the data store. |
DataCommand |
getCommand()
Returns the DataCommand instance for this DataProvider, assigned with setCommand(DataCommand) . |
DataConnection |
getConnection()
|
void |
load(DataTable t)
|
void |
load(DataTable[] tables)
|
void |
loadAndWait(DataTable t)
|
void |
loadAndWait(DataTable[] tables)
|
void |
removePropertyChangeListener(java.lang.String propertyName,
java.beans.PropertyChangeListener listener)
Stops notifying a specific listener of changes to a specific property. |
protected void |
runTask(Task runner)
Invoked by the load or save methods. |
protected void |
runTaskAndWait(Task runner)
|
void |
save(DataTable t)
|
void |
save(DataTable[] tables)
|
void |
saveAndWait(DataTable t)
|
void |
saveAndWait(DataTable[] tables)
|
void |
setCommand(DataCommand cmd)
Assigns the single DataCommand instance used by this provider to execute load and store operations. |
void |
setConnection(DataConnection conn)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DataProvider()
Method Detail |
---|
public void load(DataTable[] tables)
public void loadAndWait(DataTable[] tables)
public void load(DataTable t)
public void loadAndWait(DataTable t)
public void save(DataTable t)
public void saveAndWait(DataTable t)
public void save(DataTable[] tables)
public void saveAndWait(DataTable[] tables)
protected abstract SaveTask createSaveTask(DataTable[] tables)
protected abstract LoadTask createLoadTask(DataTable[] tables)
protected void runTask(Task runner)
load
or save
methods.
This method will be called on the EventDispatch thread, and therefore
must not block. This method is provided to allow concrete subclasses to
provide a custom thread creation/scheduling implementation.
runner
- protected void runTaskAndWait(Task runner)
public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
listener
- The PropertyChangeListener to notify of changes to this
instance.public void addPropertyChangeListener(java.lang.String propertyName, java.beans.PropertyChangeListener listener)
propertyName
- The name of the property to listen to changes for.listener
- The PropertyChangeListener to notify of changes to this
instance.public void removePropertyChangeListener(java.lang.String propertyName, java.beans.PropertyChangeListener listener)
propertyName
- The name of the property to ignore from now on.listener
- The listener to stop receiving notifications.public void setCommand(DataCommand cmd)
cmd
- The DataCommand instance to use for load/store operations.public DataCommand getCommand()
setCommand(DataCommand)
.
public void setConnection(DataConnection conn)
public DataConnection getConnection()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |