public abstract class Controller<V> extends Object implements Serializable
Note: It is imperative that sub-classes set
application to a valid instance.
©Copyright 2006 Sans Pareil Technologies, Inc.
| Modifier and Type | Class and Description |
|---|---|
class |
Controller.Updater<S>
An abstract updater task used to execute timed tasks in the
background and
push updates to the UI. |
protected class |
Controller.Worker<S>
An abstract worker thread used to execute tasks in the background to avoid locking up
the UI.
|
| Modifier and Type | Field and Description |
|---|---|
protected Application |
application
The global application instance for each session.
|
protected static Logger |
logger
The logger used to log errors to.
|
protected V |
view
The view that is controlled by this instance.
|
| Constructor and Description |
|---|
Controller(V view)
Crete a new instance of the controller for the specified view.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addPane(FloatingPane pane)
Add the specified
FloatingPane to the
ContentPane of Application.window with an
appropriate z-index. |
static boolean |
checkText(String text)
Check the specified string to ensure that it is not
null
and not empty. |
Application |
getApplication()
Returns
application. |
String |
getDataDirectory()
Convenience method that returns
Application.dataDirectory. |
Logger |
getLogger()
Return the logger associated with this controller.
|
V |
getView()
Returns
view. |
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.
|
protected void |
setApplication(Application application)
Set
application. |
protected static final Logger logger
protected Application application
protected final V view
public Controller(V view)
view - The view this controller controls.public static boolean checkText(String text)
null
and not empty. Strings that are composed entirely of spaces are also
treated as empty.text - The text that is to be checked.true if the string specified is not null
or empty.public Application getApplication()
application.protected void setApplication(Application application)
application.application - The value to set.public Logger getLogger()
public String getDataDirectory()
Application.dataDirectory.public void addPane(FloatingPane pane)
FloatingPane to the
ContentPane of Application.window with an
appropriate z-index. Convenience wrapper around Application.addPane(nextapp.echo2.app.FloatingPane).pane - The window pane that is to be added.public void processFatalException(Throwable t)
t - The fatal exceptionApplication.processFatalException( Throwable )public void processFatalException(String message, Throwable t)
message - The message to display in the ErrorPane.t - The fatal exceptionApplication.processFatalException( String, Throwable )