|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.scopemvc.controller.basic.ViewContext
ViewContext handles show/hide of views, errors and has some concept of the application's context. eg a Swing implementation would show views inside JFrames or JDialogs and show errors using JOptionPanes. A servlet implementation would know about the HTTP response and push views into its stream.
There's a place in here to store properties per context. This is used in the servlet implementation to maintain state over a single request.
Several static methods are used to set the context for an application either
on a global basis (eg Swing) or per-thread (eg servlet): see getViewContext()
etc.
Constructor Summary | |
ViewContext()
|
Method Summary | |
void |
addProperty(java.lang.String inKey,
java.lang.Object inObject)
Store an arbitrary object under a known key. |
void |
clearProperties()
Clear all properties from this context. |
static void |
clearThreadContext()
Clear the ViewContext for the current thread. |
abstract void |
exit()
Exit the application |
java.lang.Object |
getProperty(java.lang.String inKey)
Fetch an arbitrary object under a known key. |
static ViewContext |
getViewContext()
Return the current ViewContext. |
abstract void |
hideView(View inView)
Hide the view |
java.lang.Object |
removeProperty(java.lang.String inKey)
Fetch and remove an arbitrary object under a known key. |
static void |
setGlobalContext(ViewContext inContext)
Set the global ViewContext. |
static void |
setThreadContext(ViewContext inContext)
Set a ViewContext for the current thread. |
abstract void |
showError(java.lang.String inErrorTitle,
java.lang.String inErrorMessage)
Show an error message. |
abstract void |
showView(View inView)
Show the view |
abstract void |
startProgress()
Start a progress indicator for long operations. |
abstract void |
stopProgress()
Stop the progress indicator. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public ViewContext()
Method Detail |
public static ViewContext getViewContext()
public static void setGlobalContext(ViewContext inContext)
inContext
- The new globalContext valuepublic static void setThreadContext(ViewContext inContext)
inContext
- The new threadContext valuepublic static void clearThreadContext()
public java.lang.Object getProperty(java.lang.String inKey)
inKey
- The property key
public abstract void showView(View inView)
inView
- The view to showpublic abstract void hideView(View inView)
inView
- The view to hidepublic abstract void showError(java.lang.String inErrorTitle, java.lang.String inErrorMessage)
inErrorTitle
- The title for the error messageinErrorMessage
- The error messagepublic abstract void exit()
public abstract void startProgress()
public abstract void stopProgress()
public void addProperty(java.lang.String inKey, java.lang.Object inObject)
inKey
- The element to be added to the Property attributeinObject
- The element to be added to the Property attributepublic java.lang.Object removeProperty(java.lang.String inKey)
inKey
- The property key
public void clearProperties()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |