|
SPT Core API | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.sptci.echo.Listener<V>
public abstract class Listener<V extends View>
An abstract base class for action listeners. Provides common error checking methods and also methods to process annotations to automate field checking.
Copyright 2006 Sans Pareil Technologies, Inc.
| Field Summary | |
|---|---|
protected static Logger |
logger
The logger to use to log errors/messages to. |
| Constructor Summary | |
|---|---|
Listener()
|
|
| Method Summary | |
|---|---|
protected boolean |
checkText(String text)
Check the specified string to ensure that it is not null
and not empty. |
protected boolean |
checkTextComponent(Object obj,
Constraints constraints)
Check the specified component if it is a text component to ensure that the input value matches the annotated constratints. |
protected boolean |
checkView(V view)
Check the specified view to ensure that mandatory components have been assigned values. |
protected Application |
getApplication()
Convenience method to return the application instance for the session. |
protected V |
getView(ActionEvent event)
Return the parent view from which the action event was triggered. |
protected void |
processFatalException(String message,
Throwable t)
A global handler for exceptions encountered while updating the display. |
protected void |
processFatalException(Throwable t)
A global handler for exceptions encountered while updating the display. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface nextapp.echo.app.event.ActionListener |
|---|
actionPerformed |
| Field Detail |
|---|
protected static final Logger logger
| Constructor Detail |
|---|
public Listener()
| Method Detail |
|---|
protected V getView(ActionEvent event)
View marker
interface.
event - The action event that was triggered.
protected boolean checkView(V view)
Constraints annotations
on the view to determine whether all mandatory components have
been assigned values. This method processes only the following types
of components at present:
view - The view that is to be checked.
true if the default checks pass.checkTextComponent(Object, com.sptci.echo.annotation.Constraints),
checkListComponent(Object, com.sptci.echo.annotation.Constraints)
protected boolean checkTextComponent(Object obj,
Constraints constraints)
obj - The component that is to be checked.constraints - The annotated constraints.
true if the object is not a text component or if
it matches all the constraints.protected Application getApplication()
Application.getApplication()protected void processFatalException(Throwable t)
t - The fatal exceptionApplication.processFatalException( Throwable )
protected void processFatalException(String message,
Throwable t)
message - The message to display in the ErrorPane.t - The fatal exceptionApplication.processFatalException( String, Throwable )protected 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.
|
SPT Core API | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||