|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object nl.coderight.jazz.Controller
public abstract class Controller
Controller
is part of the HMVC pattern.
Example: public class MyController extends Controller { private MyModel myModel; private MyView myView; public void handleEvent(MyEvent evt) { switch (evt.getType()) { case EDIT: executeController(new MyController()); break; case EXPORT: executeTask(new ExportTask()); break; } } public void execute() { myModel = new MyModel(); myView = new MyView(); setModel(myModel); setView(myView); showView(); } }
Default event-handlers:
Nested Class Summary | |
---|---|
static class |
Controller.EventNotHandledException
RuntimeException, thrown when an event is not handled. |
Constructor Summary | |
---|---|
Controller()
Default constructor. |
Method Summary | |
---|---|
void |
closeView()
Close the View . |
abstract void |
execute()
Executes this controller. |
void |
executeController(Controller controller)
Executes a Controller asynchronously. |
void |
executeTask(Task task)
Executes a Task asynchronously. |
Application |
getApplication()
Returns the Application . |
Model |
getModel()
Returns the Model for this controller. |
View |
getView()
Returns the View for this controller. |
void |
handleEvent(FormModelEvent evt)
|
void |
handleEvent(ProgressEvent evt)
Default handling of ProgressEvent . |
void |
handleEvent(ViewEvent evt)
Default handling of ViewEvent . |
protected void |
onAfterShowView()
Invoked after view is visible. |
protected void |
onBeforeShowView()
Invoked before view is visible. |
protected void |
onEventNotHandled(Event event)
Invoked when an event is not handled. |
void |
propagateEvent(Event event)
Propagate Event to parent Controller . |
void |
scheduleTask(Task task,
nl.coderight.jazz.Task.Schedule schedule)
Schedules a Task asynchronously. |
void |
setModel(Model model)
Sets the Model for this controller. |
void |
setView(View view)
Sets the View for this controller. |
void |
showView()
Show the View with default modality (MODELESS). |
void |
showView(Dialog.ModalityType modality)
Show the View with given modality. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Controller()
Method Detail |
---|
public final void scheduleTask(Task task, nl.coderight.jazz.Task.Schedule schedule)
Task
asynchronously.
Task.FixedDelaySchedule
,
Task.FixedRateSchedule
public final void executeTask(Task task)
Task
asynchronously.
public final void executeController(Controller controller)
Controller
asynchronously.
public abstract void execute()
Example: public void execute() { model = new Model(); view = new View(); setModel(model); setView(view); showView(); }
public final View getView()
View
for this controller.
public final void setView(View view)
View
for this controller.
public final Model getModel()
Model
for this controller.
public final void setModel(Model model)
Model
for this controller.
public final void showView()
View
with default modality (MODELESS).
#showView(ModalityType)
public final void showView(Dialog.ModalityType modality)
View
with given modality.
public final void closeView()
View
.
public final Application getApplication()
Application
.
public void handleEvent(ViewEvent evt)
ViewEvent
.
OPEN: change the mouse cursor shape toCursor.WAIT_CURSOR
SHOW: change the mouse cursor shape toCursor.DEFAULT_CURSOR
public void handleEvent(ProgressEvent evt)
ProgressEvent
.
When theView
has aProgressMonitor
: START ->ProgressMonitor.startProgress(ProgressEvent)
UPDATE ->ProgressMonitor.updateProgress(ProgressEvent)
STOP ->ProgressMonitor.stopProgress(ProgressEvent)
View.setProgressMonitor(ProgressMonitor)
,
ProgressMonitor
public final void handleEvent(FormModelEvent evt)
public final void propagateEvent(Event event) throws Controller.EventNotHandledException
Event
to parent Controller
.
Controller.EventNotHandledException
protected void onBeforeShowView()
protected void onAfterShowView()
protected void onEventNotHandled(Event event)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |