com.sptci.echo2
Class Controller<V>

java.lang.Object
  extended by com.sptci.echo2.Controller<V>
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
LoginPaneController, PasswordController

public abstract class Controller<V>
extends Object
implements Serializable

An abstract base class for all controllers.

Note: It is imperative that sub-classes set application to a valid instance.

Copyright 2006 Sans Pareil Technologies, Inc.

Version:
$Id: Controller.java 3099 2007-04-22 13:39:37Z rakesh $
Author:
Rakesh Vidyadharan 2006-05-16
See Also:
Serialized Form

Nested Class Summary
 class Controller.LinkedCellRenderer
          A custom table cell renderer used to present the cell data as hyper linked.
 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.
 
Field Summary
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 Summary
Controller(V view)
          Crete a new instance of the controller for the specified view.
 
Method Summary
 boolean checkText(String text)
          Check the specified string to ensure that it is not null and not empty.
 Application getApplication()
          Returns application.
 Logger getLogger()
          Return the logger associated with this controller.
 V getView()
          Returns view.
 void processFatalException(Throwable t)
          A global handler for exceptions encountered while updating the display.
protected  void setApplication(Application application)
          Set application.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected static final Logger logger
The logger used to log errors to.


application

protected Application application
The global application instance for each session.


view

protected final V view
The view that is controlled by this instance.

Constructor Detail

Controller

public Controller(V view)
Crete a new instance of the controller for the specified view.

Method Detail

checkText

public boolean checkText(String text)
Check the specified string to ensure that it is not null and not empty. Strings that are composed entirely of spaces are also treated as empty.

Parameters:
text - The text that is to be checked.
Returns:
Return true if the string specified is not null or empty.

getApplication

public Application getApplication()
Returns application.

Returns:
Application The value/reference of/to application.

setApplication

protected void setApplication(Application application)
Set application.

Parameters:
application - The value to set.

getView

public V getView()
Returns view.

Returns:
V The value/reference of/to view.

getLogger

public Logger getLogger()
Return the logger associated with this controller.


processFatalException

public void processFatalException(Throwable t)
A global handler for exceptions encountered while updating the display.

Parameters:
t - The fatal exception
See Also:
Application.processFatalException(java.lang.Throwable)