Source Code Cross Referenced for WMenuItemGlobal.java in  » Database-ORM » SimpleORM » simpleorm » simplewebapp » core » 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 » Database ORM » SimpleORM » simpleorm.simplewebapp.core 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        package simpleorm.simplewebapp.core;
002:
003:        import simpleorm.simplewebapp.core.WPage;
004:        import simpleorm.simplewebapp.core.WPageStructure;
005:        import simpleorm.simplewebapp.requestlet.WPageRenderer;
006:        import simpleorm.simplewebapp.requestlet.WJspRenderer;
007:
008:        /**
009:         * An leaf items on a menu, used to both display menus and dispatch calls to jsps.<p>
010:         *
011:         * WARNING These are generally Global (ie final values), see WGlobalState.
012:         * Do not modify them on a per page basis, but do refer to them using
013:         * WPageStructure.getPageItem etc. in case there are local coplies.<p>
014:         *
015:         */
016:        public class WMenuItemGlobal extends WMenuAbstractGlobal {
017:            Class<? extends WPage> pageClass; // The wPage class that processes this entry
018:            String role; // required to access program
019:
020:            /**
021:             * We make a special case of the successItem to go to when a crud form is successful.
022:             * For all other links are encoded within the pages themselves.
023:             * We do not want to add a Struts-like extra level of indirection in general.
024:             * But for this common case we want to be able to return to the "caller" which may change.
025:             * (Maybe this should be changed later?)
026:             */
027:            WMenuItemGlobal successItem;
028:
029:            Class<? extends WPageRenderer> renderer = WJspRenderer.class;
030:
031:            public WMenuItemGlobal(WMenuParentGlobal parent) {
032:                super (parent);
033:            }
034:
035:            /** Needed for JSPs to grey out menu items -- geters cannot have parameters.
036:             * We also allow for the possibility that Menus are not associated directly with pages. */
037:            public boolean isAccessible() {
038:                return WPageStructure.getThreadPage().getPageSecurity()
039:                        .isAccessible(this );
040:            }
041:
042:            /** Returns the address of the jsp for this, eg. /Simple/manuallist.jsp */
043:            public String jspUrl() {
044:                return "/" + parent.getName() + "/" + pageClass.getSimpleName()
045:                        + ".jsp";
046:            }
047:
048:            /** Sets .pageClass and .name */
049:            public void setPageClassName(Class<? extends WPage> page) {
050:                pageClass = page;
051:                name = pageClass.getSimpleName();
052:            }
053:
054:            public String toString() {
055:                return "{WMenuItemGlobal " + name + " " + swbUrl + "}";
056:            }
057:
058:            ////// GENERATED ////////
059:
060:            public Class<? extends WPage> getPageClass() {
061:                return pageClass;
062:            }
063:
064:            public String getRole() {
065:                return role;
066:            }
067:
068:            public WMenuItemGlobal setRole(String role) {
069:                this .role = role;
070:                return this ;
071:            }
072:
073:            public WMenuItemGlobal getSuccessItem() {
074:                return successItem;
075:            }
076:
077:            public WMenuItemGlobal setSuccessItem(WMenuItemGlobal successItem) {
078:                this .successItem = successItem;
079:                return this ;
080:            }
081:
082:            /** Creates the WPage for this item and sets its its menu item.*/
083:            public <T extends WPage> T newPage() throws Exception {
084:                Class<? extends WPage> pageClass = getPageClass();
085:                WPage page = pageClass.newInstance(); // Beware that a lot of initialization happens here
086:                WPageStructure struct = page.getPageStructure();
087:                struct.setPageItem(this ); // Note that this happens AFTER the newInstance().
088:                // Note that ObjectInputStream.readObject() (deserialize) somehow does not call constructors -- might be a dirty work around
089:                return (T) page;
090:            }
091:
092:            public Class<? extends WPageRenderer> getRenderer() {
093:                return renderer;
094:            }
095:
096:            public WMenuItemGlobal setRenderer(
097:                    Class<? extends WPageRenderer> renderer) {
098:                this.renderer = renderer;
099:                return this;
100:            }
101:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.