|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jdesktop.dataset.provider.AbstractTask
org.jdesktop.dataset.provider.LoadTask
public abstract class LoadTask
Nested Class Summary | |
---|---|
static class |
LoadTask.LoadItem<E>
Represents a Unit of data, ready to be loaded. |
Constructor Summary | |
---|---|
LoadTask(DataTable[] tables)
Creates a new LoadTask. |
Method Summary | |
---|---|
boolean |
cancel()
|
java.lang.String |
getDescription()
|
javax.swing.Icon |
getIcon()
|
java.lang.String |
getMessage()
|
protected abstract void |
loadData(LoadTask.LoadItem[] items)
Invoked internally once the readData method calls
scheduleLoad to schedule the loading of an increment of
data to the DataTable. |
protected abstract void |
readData(DataTable[] tables)
Subclasses must implement this method to read the data from the data store and place it in a data structure which is disconnected from the DataTable. |
void |
run()
|
protected void |
scheduleLoad()
Same as scheduleLoad(LoadItem) , except that this method
will simply schedule a load operation for any remaining items in the
queue, but will not add any items to the queue. |
protected void |
scheduleLoad(LoadTask.LoadItem item)
Invoked by the readData method from the "reader"
thread to schedule a subsequent call to loadData on the
event dispatch thread. |
void |
setLoadOnEDT(boolean val)
|
Methods inherited from class org.jdesktop.dataset.provider.AbstractTask |
---|
canCancel, getMaximum, getMinimum, getProgress, isIndeterminate, isModal, setCanCancel, setIndeterminate, setMaximum, setMinimum, setModel, setProgress |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public LoadTask(DataTable[] tables)
Method Detail |
---|
public void setLoadOnEDT(boolean val)
public void run()
protected abstract void readData(DataTable[] tables) throws java.lang.Exception
scheduleLoad
, which will cause
loadData
to be called on the event dispatch thread, where
the model may be safely updated. Progress events may be fired from this
method.
A final scheduleLoad
will be called automatically at the
conclusion of the loading process, so it is not technically necessary
for this method to call scheduleLoad
at all unless you
want to support partial loads.
java.lang.Exception
- if errors occur while reading datascheduleLoad(org.jdesktop.dataset.provider.LoadTask.LoadItem)
protected abstract void loadData(LoadTask.LoadItem[] items)
readData
method calls
scheduleLoad
to schedule the loading of an increment of
data to the DataTable. This method is called on the event dispatch thread,
therefore it is safe to mutate the model from this method. Subclasses
must implement this method to load the current contents of the
disconnected data structure into the DataTable. Note that because there
is an unpredictable delay between the time scheduleLoad
is
called from the "reader" thread and loadData
executes on the event dispatch thread, there may be more data available
for loading than was available when scheduleLoad
was
invoked. All available data should be loaded from this method.
This method should fire an appropriate progress event to notify progress listeners when:
protected void scheduleLoad(LoadTask.LoadItem item)
readData
method from the "reader"
thread to schedule a subsequent call to loadData
on the
event dispatch thread. If readData
invokes
scheduleLoad
multiple times before loadData
has the opportunity to execute on the event dispatch thread, those
requests will be collapsed, resulting in only a single call to
loadData
.
readData(org.jdesktop.dataset.DataTable[])
,
loadData(org.jdesktop.dataset.provider.LoadTask.LoadItem[])
protected void scheduleLoad()
scheduleLoad(LoadItem)
, except that this method
will simply schedule a load operation for any remaining items in the
queue, but will not add any items to the queue.
public java.lang.String getDescription()
public javax.swing.Icon getIcon()
public java.lang.String getMessage()
public boolean cancel() throws java.lang.Exception
java.lang.Exception
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |