|
SPT Core API | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnextapp.echo.app.ApplicationInstance
com.sptci.echo.Application
public class Application
A base class that extends ApplicationInstance and
can serve as the base class for the application specific
global application instance.
© Copyright 2006 Sans Pareil Technologies, Inc.
| Field Summary | |
|---|---|
protected String |
contentPane
The fully qualified name of the ContentPane class that will
be set as the content of window. |
protected String |
dataDirectory
The root directory under which persistent state is stored. |
protected static Logger |
logger
The logger to use to log errors/messages to. |
static int |
MINIMUM_INTERVAL
The minimum interval at which tasks will be enqueued. |
protected int |
pollingInterval
The polling interval as which any tasks in updateTasks will
be executed. |
protected Principal |
principal
The object that represents the name of the currently authenticated user. |
protected Map<String,Object> |
properties
A map to store arbitrary properties in the application session scope. |
protected static Map<String,TimeZone> |
TIME_ZONES
A map that is used to store the time offsets from UTC and their corresponding time zone short names. |
protected TimeZone |
timeZone
The time zone for the client browser. |
protected User |
user
The value object that represents the user currently logged on to the application. |
protected Window |
window
The Window instance that will be controlled by this
application. |
| Fields inherited from class nextapp.echo.app.ApplicationInstance |
|---|
FOCUSED_COMPONENT_CHANGED_PROPERTY, ID_STRING, LOCALE_CHANGED_PROPERTY, MODAL_COMPONENTS_CHANGED_PROPERTY, STYLE_SHEET_CHANGED_PROPERTY, WINDOWS_CHANGED_PROPERTY |
| Constructor Summary | |
|---|---|
Application()
Default constructor. |
|
| Method Summary | |
|---|---|
void |
addPane(FloatingPane pane)
Add the specified FloatingPane to the
ContentPane of window with an
appropriate z-index. |
protected void |
addTask(Controller.Updater updater,
Runnable runnable)
Add the specified updater task to the task queue. |
static Application |
getApplication()
Convenience method to return the active application as a properly typed object. |
ContentPane |
getContentPane()
Convenience method that returns the ContentPane
for window. |
String |
getDataDirectory()
Returns dataDirectory. |
Locale[] |
getLocales()
Return the Locales specified by the client browser for the
current session. |
static Logger |
getLogger()
Return the logger used by the application. |
static String |
getOffset(int offset)
Parse the specified offset from UTC in milliseconds and return it in HHmm format. |
static View |
getParentView(Component component)
Return the view component that is the parent of the specified component. |
Principal |
getPrincipal()
Returns principal. |
Object |
getProperty(String key)
Fetches the property associated with the key from the application session scope. |
TimeZone |
getTimeZone()
Return the timezone of the client browser. |
User |
getUser()
Returns user. |
Window |
getWindow()
Returns window. |
protected int |
getZIndex()
Get the z-index value to use for the next
FloatingPane component to be added. |
boolean |
hasQueuedTasks()
Over-ridden to enqueue each task in updateTasks. |
Window |
init()
The mandatory initialisation method. |
void |
processFatalException(String message,
Throwable t)
A global handler for exceptions encountered while updating the display. |
void |
processFatalException(Throwable t)
A global handler for exceptions encountered while updating the display. |
void |
removePane(FloatingPane pane)
Remove the specified FloatingPane from the
ContentPane of window. |
protected void |
removeTask(Controller.Updater updater)
Remove the specified updater task from the task queue. |
void |
setContentPane(String contentPane)
Sets the values of contentPane to the fully qualified name of
the ContentPane class. |
void |
setDataDirectory(String dataDirectory)
Set dataDirectory. |
void |
setPrincipal(Principal principal)
Set principal. |
void |
setProperty(String key,
Object value)
Add a new property to the application session scope. |
void |
setUser(User user)
Set user. |
protected void |
updatePollingInterval()
Update pollingInterval to the maximum value in the
intervals for all the tasks that are queued. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static final Logger logger
public static final int MINIMUM_INTERVAL
protected static final Map<String,TimeZone> TIME_ZONES
protected int pollingInterval
updateTasks will
be executed.
protected TimeZone timeZone
protected Window window
Window instance that will be controlled by this
application.
protected String contentPane
ContentPane class that will
be set as the content of window.
protected String dataDirectory
protected User user
protected transient Principal principal
protected final transient Map<String,Object> properties
| Constructor Detail |
|---|
public Application()
UpdateManager
for this application.
| Method Detail |
|---|
public static Application getApplication()
Application instance.public Window init()
window
and returns it.
init in class ApplicationInstancewindow.ApplicationInstance.setStyleSheet(nextapp.echo.app.StyleSheet),
Window.setContent(nextapp.echo.app.ContentPane)public void processFatalException(Throwable t)
t - The fatal exception
public void processFatalException(String message,
Throwable t)
message - The message to display regarding the error condition.t - The fatal exceptionpublic Window getWindow()
window.
public void addPane(FloatingPane pane)
FloatingPane to the
ContentPane of window with an
appropriate z-index.
pane - The window pane that is to be added.getZIndex()public void removePane(FloatingPane pane)
FloatingPane from the
ContentPane of window.
pane - The pane window pane that is to be removed.protected int getZIndex()
z-index value to use for the next
FloatingPane component to be added.
protected void addTask(Controller.Updater updater,
Runnable runnable)
updater - The updater task to run.runnable - The runnable instance to queue the task.protected void removeTask(Controller.Updater updater)
updater - The task that is to be removed from the queue.protected void updatePollingInterval()
pollingInterval to the maximum value in the
intervals for all the tasks that are queued.
public boolean hasQueuedTasks()
updateTasks.
hasQueuedTasks in class ApplicationInstancetrue if there are queued tasks.public Locale[] getLocales()
Locales specified by the client browser for the
current session. The getLocale method inherited from
ApplicationInstance returns only the locale of the server.
public TimeZone getTimeZone()
timeZone lazily.
public static String getOffset(int offset)
HHmm format. This is used to lookup TimeZone
instances.
offset - The offset from UTC in milliseconds.
public static View getParentView(Component component)
component - The component whose parent view is to be returned.
null if no parent that is an
instance of view exists.
public void setProperty(String key,
Object value)
key - The key used to identify the property.value - The value of the property.public Object getProperty(String key)
key - The key assigned to the property.
null if
no value has been assigned to the specified key.public ContentPane getContentPane()
ContentPane
for window.
Window.getContent()public void setContentPane(String contentPane)
contentPane to the fully qualified name of
the ContentPane class.
contentPane - The value to set.public String getDataDirectory()
dataDirectory.
public void setDataDirectory(String dataDirectory)
dataDirectory.
dataDirectory - The value to set.public User getUser()
user.
public void setUser(User user)
user.
user - The value to set.public Principal getPrincipal()
principal.
public void setPrincipal(Principal principal)
principal.
principal - The value to set.public static Logger getLogger()
logger.
|
SPT Core API | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||