Source Code Cross Referenced for PageContentBean.java in  » Content-Management-System » contineo » org » contineo » web » navigation » 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 » Content Management System » contineo » org.contineo.web.navigation 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        package org.contineo.web.navigation;
002:
003:        import com.icesoft.faces.component.tree.IceUserObject;
004:
005:        import org.contineo.core.security.Menu;
006:
007:        import org.contineo.web.StyleBean;
008:
009:        import javax.faces.event.ActionEvent;
010:
011:        /**
012:         * <p>
013:         * The PageContentBean class is responsible for holding state information which
014:         * will allow a TreeNavigation and NavigationBean display dynamic content.
015:         * </p>
016:         *
017:         * @author Marco Meschieri
018:         * @version $Id: PageContentBean.java,v 1.10 2006/09/03 11:40:19 marco Exp $
019:         * @since 3.0
020:         */
021:        public class PageContentBean extends IceUserObject {
022:            private Menu menu;
023:
024:            // template, default panel to make visible in a panel stack
025:            private String contentName = "";
026:
027:            // text to be displayed in navigation link
028:            private String displayText;
029:
030:            // title information to be displayed
031:            private String contentTitle;
032:            private String template = "";
033:            private boolean pageContent = true;
034:
035:            // view reference to control the visible content
036:            private NavigationBean navigationBean;
037:
038:            public PageContentBean(String contentName) {
039:                this ();
040:                setIcon(StyleBean.getImagePath("spacer.gif"));
041:                this .contentName = contentName;
042:            }
043:
044:            public PageContentBean(String contentName, String template) {
045:                this (contentName);
046:                this .template = template;
047:            }
048:
049:            public PageContentBean() {
050:                super (null);
051:                init();
052:            }
053:
054:            public PageContentBean(Menu menu) {
055:                this ();
056:                this .menu = menu;
057:            }
058:
059:            /**
060:             * Initialize internationalization.
061:             */
062:            private void init() {
063:                setBranchContractedIcon(StyleBean.XP_BRANCH_CONTRACTED_ICON);
064:                setBranchExpandedIcon(StyleBean.XP_BRANCH_EXPANDED_ICON);
065:                setLeafIcon(StyleBean.XP_BRANCH_CONTRACTED_ICON);
066:                setExpanded(false);
067:                setLeaf(false);
068:                setIcon(StyleBean.getImagePath("spacer.gif"));
069:            }
070:
071:            /**
072:             * Gets the navigation callback.
073:             *
074:             * @return NavigationBean.
075:             */
076:            public NavigationBean getNavigationSelection() {
077:                return navigationBean;
078:            }
079:
080:            /**
081:             * Sets the navigation callback.
082:             *
083:             * @param navigationBean controls selected panel state.
084:             */
085:            public void setNavigationSelection(NavigationBean navigationBean) {
086:                this .navigationBean = navigationBean;
087:            }
088:
089:            /**
090:             * Gets the template name to display in the showcase.jspx. The template is a
091:             * panel in a panel stack which will be made visible.
092:             *
093:             * @return panel stack template name.
094:             */
095:            public String getContentName() {
096:                return contentName;
097:            }
098:
099:            /**
100:             * Sets the template name to be displayed when selected in tree. Selection
101:             * will only occur if pageContent is true.
102:             *
103:             * @param contentName valid panel name in showcase.jspx
104:             */
105:            public void setContentName(String templateName) {
106:                this .contentName = templateName;
107:            }
108:
109:            /**
110:             * Gets the menu display text. This text will be shown in the navigation
111:             * control.
112:             *
113:             * @return menu display text.
114:             */
115:            public String getDisplayText() {
116:                return displayText;
117:            }
118:
119:            /**
120:             * Sets the text to be displayed in the menu. This text string must match a
121:             * resource property in
122:             * com.icesoft.icefaces.samples.showcase.resources.messages
123:             *
124:             * @param displayText menu text to display
125:             */
126:            public void setDisplayText(String menuDisplayText) {
127:                this .displayText = menuDisplayText;
128:                setText(getDisplayText());
129:            }
130:
131:            /**
132:             * Get the text to be displayed as the content title. This text string must
133:             * match resource property in
134:             * com.icesoft.icefaces.samples.showcase.resources.messages
135:             *
136:             * @return menu content title
137:             */
138:            public String getContentTitle() {
139:                return contentTitle;
140:            }
141:
142:            /**
143:             * Sets the menu content title.
144:             *
145:             * @param contentTitle menu content title name.
146:             */
147:            public void setContentTitle(String menuContentTitle) {
148:                this .contentTitle = menuContentTitle;
149:            }
150:
151:            public String getTemplate() {
152:                return template;
153:            }
154:
155:            /**
156:             * This is necessary for the Facelets version of component-showcase. Unlike
157:             * the JSP version of component-showcase, which uses static includes, the
158:             * Facelets version uses dynamic inclusion tied to an EL expression, which
159:             * will call getMenuContentInclusionFile().
160:             *
161:             * @param template The server-side path to the file to be included
162:             */
163:            public void setTemplate(String menuContentInclusionFile) {
164:                this .template = menuContentInclusionFile;
165:            }
166:
167:            /**
168:             * Does the node contain content.
169:             *
170:             * @return true if the page contains content; otherwise, false.
171:             */
172:            public boolean isPageContent() {
173:                return pageContent;
174:            }
175:
176:            /**
177:             * Sets the page content.
178:             *
179:             * @param pageContent True if the page contains content; otherwise, false.
180:             */
181:            public void setPageContent(boolean pageContent) {
182:                this .pageContent = pageContent;
183:            }
184:
185:            public Menu getMenu() {
186:                return menu;
187:            }
188:
189:            public int getMenuId() {
190:                if (menu != null) {
191:                    return menu.getMenuId();
192:                } else {
193:                    return -1;
194:                }
195:            }
196:
197:            public void setMenu(Menu menu) {
198:                this .menu = menu;
199:            }
200:
201:            public String getIcon() {
202:                return icon;
203:            }
204:
205:            public void setIcon(String icon) {
206:                this .icon = icon;
207:            }
208:
209:            /**
210:             * Item selection handler
211:             */
212:            public void onSelect(ActionEvent event) {
213:                if (isPageContent()) {
214:                    if (navigationBean == null) {
215:                        return;
216:                    }
217:
218:                    // only toggle the branch expansion if we have already selected the
219:                    // node
220:                    if (navigationBean.getSelectedPanel().equals(this )) {
221:                        // toggle the branch node expansion
222:                        setExpanded(!isExpanded());
223:                    }
224:
225:                    navigationBean.setSelectedPanel(this );
226:                }
227:                // Otherwise toggle the node visibility, only changes the state
228:                // of the nodes with children.
229:                else {
230:                    setExpanded(!isExpanded());
231:                }
232:            }
233:
234:            @Override
235:            public boolean equals(Object obj) {
236:                PageContentBean other = (PageContentBean) obj;
237:
238:                if ((other != null) && (other.getContentName() != null)
239:                        && (contentName != null)) {
240:                    return this .contentName.equals(other.getContentName());
241:                } else {
242:                    return false;
243:                }
244:            }
245:
246:            @Override
247:            public String toString() {
248:                return displayText;
249:            }
250:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.