|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.google.gwt.user.client.ui.UIObject com.google.gwt.user.client.ui.Widget com.google.gwt.user.client.ui.Composite org.kuali.student.common.ui.client.mvc.Controller
public abstract class Controller
Abstract Controller composite. Provides basic controller operations, and defines abstract methods that a composite must implement in order to be a controller.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class com.google.gwt.user.client.ui.UIObject |
---|
com.google.gwt.user.client.ui.UIObject.DebugIdImpl, com.google.gwt.user.client.ui.UIObject.DebugIdImplEnabled |
Field Summary | |
---|---|
private com.google.gwt.event.shared.HandlerManager |
applicationEventHandlers
|
protected ViewContext |
context
|
private String |
controllerId
|
private View |
currentView
|
private Enum<?> |
currentViewEnum
|
private String |
defaultModelId
|
private boolean |
fireNavEvents
|
private Map<String,ModelProvider<? extends Model>> |
models
|
static Callback<Boolean> |
NO_OP_CALLBACK
|
protected Controller |
parentController
|
Fields inherited from class com.google.gwt.user.client.ui.UIObject |
---|
DEBUG_ID_PREFIX |
Constructor Summary | |
---|---|
protected |
Controller(String controllerId)
|
Method Summary | ||
---|---|---|
com.google.gwt.event.shared.HandlerRegistration |
addApplicationEventHandler(com.google.gwt.event.shared.GwtEvent.Type type,
ApplicationEventHandler handler)
Registers an application eventhandler. |
|
void |
beforeViewChange(Enum<?> viewChangingTo,
Callback<Boolean> okToChangeCallback)
If a controller which extends this class must perform some action or check before a view is changed, then override this method. |
|
private
|
beginShowView(View view,
V viewType,
Callback<Boolean> onReadyCallback)
|
|
void |
clearViewContext()
|
|
String |
collectHistory(String historyStack)
|
|
private
|
finalizeShowView(View view,
V viewType,
Callback<Boolean> onReadyCallback)
|
|
static Controller |
findController(com.google.gwt.user.client.ui.Widget w)
Attempts to find the parent controller of a given widget via the DOM |
|
void |
fireApplicationEvent(ApplicationEvent event)
Fires an application event. |
|
void |
fireNavEvents(boolean fireEvents)
|
|
protected void |
fireNavigationEvent()
|
|
String |
getControllerId()
|
|
View |
getCurrentView()
Returns the currently displayed view |
|
Enum<?> |
getCurrentViewEnum()
|
|
String |
getDefaultModelId()
|
|
protected String |
getHistoryToken()
|
|
Controller |
getParentController()
Returns the parent controller. |
|
protected abstract
|
getView(V viewType,
Callback<View> callback)
Returns the view associated with the specified enum value. |
|
ViewContext |
getViewContext()
|
|
abstract Enum<?> |
getViewEnumValue(String enumValue)
|
|
abstract Class<? extends Enum<?>> |
getViewsEnum()
|
|
protected abstract void |
hideView(View view)
Must be implemented by the subclass to hide the view. |
|
void |
onHistoryEvent(String historyStack)
|
|
|
registerModel(String modelId,
ModelProvider<T> provider)
|
|
protected abstract void |
renderView(View view)
Must be implemented by the subclass to render the view. |
|
void |
requestModel(Class modelType,
ModelRequestCallback callback)
Called by child views and controllers to request a model reference. |
|
void |
requestModel(ModelRequestCallback callback)
|
|
void |
requestModel(String modelId,
ModelRequestCallback callback)
|
|
void |
resetCurrentView()
|
|
void |
setCurrentViewEnum(Enum<?> currentViewEnum)
|
|
void |
setDefaultModelId(String defaultModelId)
|
|
void |
setParentController(Controller controller)
Sets the controller's parent controller. |
|
void |
setViewContext(ViewContext viewContext)
|
|
abstract void |
showDefaultView(Callback<Boolean> onReadyCallback)
Shows the default view. |
|
|
showView(V viewType)
Simple Version of showView, no callback |
|
|
showView(V viewType,
Callback<Boolean> onReadyCallback)
Directs the controller to display the specified view. |
Methods inherited from class com.google.gwt.user.client.ui.Composite |
---|
getWidget, initWidget, isAttached, onAttach, onBrowserEvent, onDetach, setWidget |
Methods inherited from class com.google.gwt.user.client.ui.Widget |
---|
addDomHandler, addHandler, delegateEvent, doAttachChildren, doDetachChildren, fireEvent, getHandlerCount, getLayoutData, getParent, isOrWasAttached, onLoad, onUnload, removeFromParent, setLayoutData, sinkEvents |
Methods inherited from class com.google.gwt.user.client.ui.UIObject |
---|
addStyleDependentName, addStyleName, ensureDebugId, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getElement, getOffsetHeight, getOffsetWidth, getStyleElement, getStyleName, getStyleName, getStylePrimaryName, getStylePrimaryName, getTitle, isVisible, isVisible, onEnsureDebugId, removeStyleDependentName, removeStyleName, setElement, setElement, setHeight, setPixelSize, setSize, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setTitle, setVisible, setVisible, setWidth, toString, unsinkEvents |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.kuali.student.common.ui.client.mvc.breadcrumb.BreadcrumbSupport |
---|
collectBreadcrumbNames |
Field Detail |
---|
public static final Callback<Boolean> NO_OP_CALLBACK
private final String controllerId
protected Controller parentController
private View currentView
private Enum<?> currentViewEnum
private String defaultModelId
protected ViewContext context
private final Map<String,ModelProvider<? extends Model>> models
private boolean fireNavEvents
private com.google.gwt.event.shared.HandlerManager applicationEventHandlers
Constructor Detail |
---|
protected Controller(String controllerId)
Method Detail |
---|
public <V extends Enum<?>> void showView(V viewType)
V
- view enum typeviewType
- enum value representing the view to showpublic <V extends Enum<?>> void showView(V viewType, Callback<Boolean> onReadyCallback)
public enum SearchViews {
SIMPLE_SEARCH,
ADVANCED_SEARCH,
SEARCH_RESULTS
}
The implementing class must define a getView(V viewType) method that will cast the generic enum to the view
specific enum.
V
- view enum typeviewType
- enum value representing the view to showonReadyCallback
- the callback to invoke when the method has completed executionprivate <V extends Enum<?>> void beginShowView(View view, V viewType, Callback<Boolean> onReadyCallback)
private <V extends Enum<?>> void finalizeShowView(View view, V viewType, Callback<Boolean> onReadyCallback)
protected void fireNavigationEvent()
public View getCurrentView()
public Enum<?> getCurrentViewEnum()
public void setCurrentViewEnum(Enum<?> currentViewEnum)
public void setParentController(Controller controller)
controller
- the parent controllerpublic Controller getParentController()
public static Controller findController(com.google.gwt.user.client.ui.Widget w)
w
- the widget for which to find the parent controller
public void requestModel(Class modelType, ModelRequestCallback callback)
- Parameters:
modelType
- callback
-
public void requestModel(String modelId, ModelRequestCallback callback)
public void requestModel(ModelRequestCallback callback)
public <T extends Model> void registerModel(String modelId, ModelProvider<T> provider)
public String getDefaultModelId()
public void setDefaultModelId(String defaultModelId)
public com.google.gwt.event.shared.HandlerRegistration addApplicationEventHandler(com.google.gwt.event.shared.GwtEvent.Type type, ApplicationEventHandler handler)
type
- handler
-
public void fireApplicationEvent(ApplicationEvent event)
event
- protected abstract void renderView(View view)
view
- protected abstract void hideView(View view)
view
- protected abstract <V extends Enum<?>> void getView(V viewType, Callback<View> callback)
V
- viewType
- public void beforeViewChange(Enum<?> viewChangingTo, Callback<Boolean> okToChangeCallback)
okToChangeCallback
- public abstract void showDefaultView(Callback<Boolean> onReadyCallback)
public abstract Class<? extends Enum<?>> getViewsEnum()
public abstract Enum<?> getViewEnumValue(String enumValue)
public String collectHistory(String historyStack)
collectHistory
in interface HistorySupport
protected String getHistoryToken()
public void onHistoryEvent(String historyStack)
onHistoryEvent
in interface HistorySupport
public void setViewContext(ViewContext viewContext)
public ViewContext getViewContext()
public void clearViewContext()
public String getControllerId()
public void resetCurrentView()
public void fireNavEvents(boolean fireEvents)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |