|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
A context for adding messages to a central pool of messages for later output with a consistent look.
A good example is StandardMessagingFilterWidget.
It registers a MessageContext in the environment and if a childservice needs to output a
message which should have a consistent look (location on the screen, styles etc.) it adds
the message via showMessage(String,String).
A widget can use the MessageContext from the environment to output the accumulated messages.
Permanent messages should stay in MessageContext until explicitly cleared, other messages should be cleared after the user has seen them once.
| Field Summary | |
static String |
ERROR_TYPE
A message type indicating its an error message. |
static String |
INFO_TYPE
A message type indicating its an info message. |
static String |
MESSAGE_REGION_KEY
|
static String |
WARNING_TYPE
A message type indicating its an info message. |
| Method Summary | |
void |
clearAllMessages()
Clears all messages (both permanent and usual). |
void |
clearMessages()
Clears all non-permanent messages. |
void |
clearPermanentMessages()
Clears all of the permanent messages. |
Map |
getMessages()
Returns all messages as a Map. |
void |
hideErrorMessage(String message)
Hides an error message from user. |
void |
hideInfoMessage(String message)
Hides an info message from user. |
void |
hideMessage(String type,
String message)
Removes a message message of type type. |
void |
hideMessages(String type,
Set messages)
Removes messages message of type type. |
void |
hidePermanentMessage(String message)
Clears the specific permanent message, under all message types where it might be present. |
void |
hideWarningMessage(String message)
Hides a warning message from user. |
void |
showErrorMessage(String message)
Shows an error message to the user. |
void |
showInfoMessage(String message)
Shows an informative message to the user. |
void |
showMessage(String type,
String message)
Shows a message message of type type to the user. |
void |
showMessages(String type,
Set messages)
Shows messages of given type to the user. |
void |
showPermanentMessage(String type,
String message)
Shows a permanent message message of type type to the user. |
void |
showWarningMessage(String message)
Shows a warning message to the user. |
| Methods inherited from interface org.araneaframework.http.UpdateRegionProvider |
getRegions |
| Field Detail |
public static final String MESSAGE_REGION_KEY
public static final String ERROR_TYPE
public static final String WARNING_TYPE
public static final String INFO_TYPE
| Method Detail |
public void showMessage(String type,
String message)
message of type type to the user.
Message is cleared after the user sees it once.
public void showMessages(String type,
Set messages)
messages of given type to the user.
Messages are cleared after the user sees them once.
messages - Set<String>
public void hideMessage(String type,
String message)
message of type type.
public void hideMessages(String type,
Set messages)
message of type type.
messages - Set<String>public void showErrorMessage(String message)
public void hideErrorMessage(String message)
public void showWarningMessage(String message)
public void hideWarningMessage(String message)
public void showInfoMessage(String message)
public void hideInfoMessage(String message)
public void clearMessages()
public void showPermanentMessage(String type,
String message)
message of type type to the user.
The message will be shown until hidden explicitly.
public void hidePermanentMessage(String message)
message - to be removed from permanent messagespublic void clearPermanentMessages()
public void clearAllMessages()
public Map getMessages()
A child service should do as follows to access the messages
...
MessageContext msgCtx = (MessageContext) getEnvironment().requireEntry(MessageContext.class);
Map map = msgCtx.getMessages();
Collection list = (Collection) map.get(MessageContext.ERROR_TYPE); // collection contains all the error messages
The map could be null if this service was not used. The collection is null if no messages of
that type been added to the messages.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||