|
ehsbe CommonsTM Version 1.1.0rc3 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface ExecService
A Service, which actually does the work described by a tasks.
Method Summary | |
---|---|
JComponent |
execute(HashMap<Task,HashMap<? extends Object,? extends Object>> settings,
TaskControl control,
EnumSet<NavMode> initalMode)
Create the UI aka wizard page, which should be displayed and do the work described by the task. |
void |
finish(HashMap<Task,HashMap<? extends Object,? extends Object>> settings,
TaskControl control,
NavMode mode)
Calculate final results for this task, cleanup resources and notify the controller, when all work has been done. |
boolean |
hasHelp()
Check, whether this task may provide any help UI. |
void |
prepare(HashMap<Task,HashMap<? extends Object,? extends Object>> settings,
TaskControl control)
Prepare all data required to setup the UI aka wizard page for a task. |
void |
showHelp(HashMap<Task,HashMap<? extends Object,? extends Object>> settings,
TaskControl control,
JComponent parent)
Show the help for this task. |
Method Detail |
---|
void prepare(HashMap<Task,HashMap<? extends Object,? extends Object>> settings, TaskControl control)
The controller makes sure, that this method gets always called before
execute(HashMap, TaskControl, EnumSet)
.
Setting navigation modes here has usually no effect and gets ignored,
since per default all navigation buttons are disabled until
execute(HashMap, TaskControl, EnumSet)
returns.
settings
- all settings and collected data so far.control
- the controller, which is in charge aka manages this task
and needs to be notified on completion/business
NullPointerException
- if an argument is null
JComponent execute(HashMap<Task,HashMap<? extends Object,? extends Object>> settings, TaskControl control, EnumSet<NavMode> initalMode)
Before this method gets called, the controller makes sure, that
prepare(HashMap, TaskControl)
has been called before. Thats why
all none-UI related preparations should be made there, so that this method
is able to return fast.
Implementations should create the UI required for user input here, add required listeners to it and return the UI. After that, the controller notifies appropriate listeners, what usually results into adding the returned component to the wizard dialog and thus it gets visible.
When the controller decides to change the current task in action, thefinish(HashMap, TaskControl, NavMode)
method gets called.
settings
- all settings and collected data so far.control
- the controller, which is in charge aka manages this task
and needs to be notified at least on completion/busyness.initalMode
- container, where to set initial navigation modes, when
the UI for this wizard gets displayed.
null
if the task does not require an UI to be executed,
the component, which is not visible, to display otherwise.
NullPointerException
- if an argument is null
Component.isVisible()
,
JComponent.setVisible(boolean)
,
TaskControl.setBusy(Task, boolean)
,
TaskControl.setLocale(Locale)
,
TaskControl.setNavMode(Task, EnumSet)
void finish(HashMap<Task,HashMap<? extends Object,? extends Object>> settings, TaskControl control, NavMode mode)
Invoked by the controller after prepare(HashMap, TaskControl)
or
execute(HashMap, TaskControl, EnumSet)
to let the task cleanup
its resources (e.g. populatated during the prepare and execute phase) and
let it calculate its final results.
Usually this method gets invoked in a none-EDT in preparation to switch to the next or previous task or to finally finish the wizard. So if some UI modifications are done, one should invoke [and wait] appropriate work in the EDT.
The task is required to call its controller's
TaskControl.finished(Task)
method, to let it know, that it may
[not] continue with the next step indicated by mode. To veto
that the controller should not continue with the intended action,
one should call its TaskControl.setNavMode(Task, EnumSet)
before
returning from this method to indicate, what is ok. However, the final
decision about what to do next will be made by the controller.
So if this task denies the intended action, this method might be called several times.
settings
- all settings and collected data so far.control
- the controller, which is in charge aka manages this task
and needs to be notified at least on completion/busyness.mode
- what the controller intends to do next.
NullPointerException
- if an argument is null
EventQueue.isDispatchThread()
,
EventQueue.invokeAndWait(Runnable)
void showHelp(HashMap<Task,HashMap<? extends Object,? extends Object>> settings, TaskControl control, JComponent parent)
This method gets usually called twice: First with parent set to
null
, i.e. none-UI work required for displaying help should be
made. Per default, it gets called outside of the EDT.
When it gets called with a none-null
parent, one may
actually do all UI related work and show the help UI. The controller
ensures, that this call gets made within the EDT.
settings
- all settings and collected data so far.control
- the controller, which is in charge aka manages this task
and needs to be notified at least on completion/busyness.parent
- where to anchor the help frame to show. null
indicates, that none-UI preparations should be made - i.e. prepare
help set, images etc.
NullPointerException
- if settings or control
is null
boolean hasHelp()
false
if calling showHelp(HashMap, TaskControl, JComponent)
is useless, i.e. does nothing.
|
ehsbe CommonsTM Version 1.1.0rc3 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |