Java Doc for MessageContext.java in  » Web-Framework » aranea-mvc-1.1.1 » org » araneaframework » framework » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Web Framework » aranea mvc 1.1.1 » org.araneaframework.framework 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


org.araneaframework.framework.MessageContext

All known Subclasses:   org.araneaframework.framework.filter.StandardMessagingFilterWidget,
MessageContext
public interface MessageContext extends UpdateRegionProvider(Code)
A context for adding messages to a central pool of messages for later output with a consistent look.

A good example is org.araneaframework.framework.filter.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.


author:
   "Toomas Römer"
author:
   Jevgeni Kabanov (ekabanov at araneaframework dot org)
author:
   Taimo Peelo (taimo@araneaframework.org)


Field Summary
final public static  StringERROR_TYPE
     A message type indicating its an error message.
final public static  StringINFO_TYPE
     A message type indicating its an info message.
final public static  StringMESSAGE_REGION_KEY
    
final public static  StringWARNING_TYPE
     A message type indicating its an info message.


Method Summary
public  voidclearAllMessages()
     Clears all messages (both permanent and usual).
public  voidclearMessages()
     Clears all non-permanent messages.
public  voidclearPermanentMessages()
     Clears all of the permanent messages.
public  MapgetMessages()
     Returns all messages as a Map.
public  voidhideErrorMessage(String message)
     Hides an error message from user.
public  voidhideInfoMessage(String message)
     Hides an info message from user.
public  voidhideMessage(String type, String message)
     Removes a message message of type type.
public  voidhideMessages(String type, Set messages)
     Removes messages message of type type.
public  voidhidePermanentMessage(String message)
     Clears the specific permanent message, under all message types where it might be present.
public  voidhideWarningMessage(String message)
     Hides a warning message from user.
public  voidshowErrorMessage(String message)
     Shows an error message to the user.
public  voidshowInfoMessage(String message)
     Shows an informative message to the user.
public  voidshowMessage(String type, String message)
     Shows a message message of type type to the user.
public  voidshowMessages(String type, Set messages)
     Shows messages of given type to the user.
public  voidshowPermanentMessage(String type, String message)
     Shows a permanent message message of type type to the user.
public  voidshowWarningMessage(String message)
     Shows a warning message to the user.

Field Detail
ERROR_TYPE
final public static String ERROR_TYPE(Code)
A message type indicating its an error message.



INFO_TYPE
final public static String INFO_TYPE(Code)
A message type indicating its an info message.



MESSAGE_REGION_KEY
final public static String MESSAGE_REGION_KEY(Code)

since:
   1.1



WARNING_TYPE
final public static String WARNING_TYPE(Code)
A message type indicating its an info message.





Method Detail
clearAllMessages
public void clearAllMessages()(Code)
Clears all messages (both permanent and usual).



clearMessages
public void clearMessages()(Code)
Clears all non-permanent messages.



clearPermanentMessages
public void clearPermanentMessages()(Code)
Clears all of the permanent messages.



getMessages
public Map getMessages()(Code)
Returns all messages as a Map. The keys of the Map are the different message types encountered so far and under the keys are the messages in a Collection.

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.


since:
   1.1



hideErrorMessage
public void hideErrorMessage(String message)(Code)
Hides an error message from user.
since:
   1.1



hideInfoMessage
public void hideInfoMessage(String message)(Code)
Hides an info message from user.
since:
   1.1



hideMessage
public void hideMessage(String type, String message)(Code)
Removes a message message of type type.
since:
   1.1



hideMessages
public void hideMessages(String type, Set messages)(Code)
Removes messages message of type type.
Parameters:
  messages - Set<String>
since:
   1.1



hidePermanentMessage
public void hidePermanentMessage(String message)(Code)
Clears the specific permanent message, under all message types where it might be present.
Parameters:
  message - to be removed from permanent messages



hideWarningMessage
public void hideWarningMessage(String message)(Code)
Hides a warning message from user.
since:
   1.1



showErrorMessage
public void showErrorMessage(String message)(Code)
Shows an error message to the user.



showInfoMessage
public void showInfoMessage(String message)(Code)
Shows an informative message to the user.



showMessage
public void showMessage(String type, String message)(Code)
Shows a message message of type type to the user. Message is cleared after the user sees it once.



showMessages
public void showMessages(String type, Set messages)(Code)
Shows messages of given type to the user. Messages are cleared after the user sees them once.
Parameters:
  messages - Set<String>
since:
   1.1



showPermanentMessage
public void showPermanentMessage(String type, String message)(Code)
Shows a permanent message message of type type to the user. The message will be shown until hidden explicitly.



showWarningMessage
public void showWarningMessage(String message)(Code)
Shows a warning message to the user.



www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.