|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnl.coderight.jazz.Controller
public abstract class Controller
Controller is part of the HMVC pattern.
Example usage:
public class MyController extends Controller {
private MyModel myModel;
private MyView myView;
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(MessageEvent evt)
Default handling of MessageEvent. |
void |
handleEvent(ProgressEvent evt)
Default handling of ProgressEvent. |
void |
handleEvent(ViewEvent evt)
Default handling of ViewEvent. |
protected void |
onAfterShowView()
Invoked after view is shown. |
protected void |
onBeforeShowView()
Invoked before view is shown. |
protected void |
onEventNotHandled(Event event)
Invoked when an event is not handled. |
void |
propagateEvent(Event event)
Propagate Event to parent Controller. |
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 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(MessageEvent evt)
MessageEvent.
When aStatusBaris set for thisView, the message is displayed on the status bar.
StatusBarpublic void handleEvent(ViewEvent evt)
ViewEvent.
OPEN: change the mouse cursor shape toCursor.WAIT_CURSORSHOW: change the mouse cursor shape toCursor.DEFAULT_CURSOR
public void handleEvent(ProgressEvent evt)
ProgressEvent.
When theViewhas aProgressMonitor: START ->ProgressMonitor.startProgress(ProgressEvent)UPDATE ->ProgressMonitor.updateProgress(ProgressEvent)STOP ->ProgressMonitor.stopProgress(ProgressEvent)
View.setProgressMonitor(ProgressMonitor),
ProgressMonitorpublic final void handleEvent(FormModelEvent evt)
public final void propagateEvent(Event event)
throws Controller.EventNotHandledException
Event to parent Controller.
Controller.EventNotHandledExceptionprotected 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 | |||||||||