Source Code Cross Referenced for IceUserObject.java in  » J2EE » ICEfaces-1.6.1 » com » icesoft » faces » component » tree » 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 » J2EE » ICEfaces 1.6.1 » com.icesoft.faces.component.tree 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Version: MPL 1.1/GPL 2.0/LGPL 2.1
003:         *
004:         * "The contents of this file are subject to the Mozilla Public License
005:         * Version 1.1 (the "License"); you may not use this file except in
006:         * compliance with the License. You may obtain a copy of the License at
007:         * http://www.mozilla.org/MPL/
008:         *
009:         * Software distributed under the License is distributed on an "AS IS"
010:         * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
011:         * License for the specific language governing rights and limitations under
012:         * the License.
013:         *
014:         * The Original Code is ICEfaces 1.5 open source software code, released
015:         * November 5, 2006. The Initial Developer of the Original Code is ICEsoft
016:         * Technologies Canada, Corp. Portions created by ICEsoft are Copyright (C)
017:         * 2004-2006 ICEsoft Technologies Canada, Corp. All Rights Reserved.
018:         *
019:         * Contributor(s): _____________________.
020:         *
021:         * Alternatively, the contents of this file may be used under the terms of
022:         * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"
023:         * License), in which case the provisions of the LGPL License are
024:         * applicable instead of those above. If you wish to allow use of your
025:         * version of this file only under the terms of the LGPL License and not to
026:         * allow others to use your version of this file under the MPL, indicate
027:         * your decision by deleting the provisions above and replace them with
028:         * the notice and other provisions required by the LGPL License. If you do
029:         * not delete the provisions above, a recipient may use your version of
030:         * this file under either the MPL or the LGPL License."
031:         *
032:         */
033:
034:        package com.icesoft.faces.component.tree;
035:
036:        import javax.swing.tree.DefaultMutableTreeNode;
037:
038:        /**
039:         * IceUserObject - the Object that constitutes a DefaultMutableTreeNode's
040:         * user-specified data.
041:         * <p/>
042:         * The TreeModel must contain a tree of DefaultMutableTreeNode instances. Each
043:         * DefaultMutableTreeNode instance encapsultes an IceUserObject. The
044:         * IceUserObject is the extension point for the application developer.</p>
045:         * <p/>
046:         * By default all nodes are folders unless the leaf attribute is set true. </p>
047:         * <p/>
048:         * If the IceUserObject does not provide sufficient state for representation of
049:         * the tree's nodes, then the application developer should extend the
050:         * IceUserObject and add state as required to their extension. When creating an
051:         * IceUserObject, the DefaultMutableTreeNode wrapper must be provided to the
052:         * constructor. Then the node's state can be set to the attributes on the
053:         * IceUserObject. </p>
054:         */
055:        public class IceUserObject {
056:
057:            protected DefaultMutableTreeNode wrapper;
058:            protected String text;
059:            protected boolean expanded;
060:            protected String tooltip;
061:            protected String action;
062:            protected TreeNode treeNode;
063:
064:            // icon fields
065:            protected String leafIcon;
066:            protected String branchExpandedIcon;
067:            protected String branchContractedIcon;
068:            protected String icon;
069:
070:            // leaf field 
071:            protected boolean leaf;
072:
073:            // rowIndex to support new TreeDataModel
074:            private int rowIndex;
075:
076:            /**
077:             * @return rowIndex
078:             */
079:            public int getRowIndex() {
080:                return rowIndex;
081:            }
082:
083:            /**
084:             * @param rowIndex
085:             */
086:            public void setRowIndex(int rowIndex) {
087:                this .rowIndex = rowIndex;
088:            }
089:
090:            //constructors
091:
092:            /**
093:             * <p>Class constructor specifying the DefaultMutableTreeNode wrapper object
094:             * that will hold a reference to this IceUserObject.</p>
095:             *
096:             * @param wrapper
097:             */
098:            public IceUserObject(DefaultMutableTreeNode wrapper) {
099:                this .wrapper = wrapper;
100:            }
101:
102:            /**
103:             * <p>Set the value of the boolean leaf attribute. Setting the leaf
104:             * attribute to true will force a tree node to be rendered as a leaf. By
105:             * default the leaf attribute is false therefore all tree nodes will default
106:             * to folders.</p>
107:             *
108:             * @param leaf
109:             */
110:            public void setLeaf(boolean leaf) {
111:                this .leaf = leaf;
112:            }
113:
114:            /**
115:             * <p>Return false if the tree node is a folder.By default all tree nodes
116:             * are folders.</p>
117:             *
118:             * @return the boolean value of the leaf attribute.
119:             */
120:            public boolean isLeaf() {
121:                return this .leaf;
122:            }
123:
124:            /**
125:             * <p>Return the value of the <code>action</code> property.</p>
126:             *
127:             * @return action
128:             */
129:            public String action() {
130:                return action;
131:            }
132:
133:            // getters/setters
134:
135:            /**
136:             * @param treeNode
137:             */
138:            public void setTreeNode(TreeNode treeNode) {
139:                this .treeNode = treeNode;
140:            }
141:
142:            /**
143:             * @return treeNode
144:             */
145:            public TreeNode getTreeNode() {
146:                return this .treeNode;
147:            }
148:
149:            /**
150:             * <p>Return the value of the <code>text</code> property.</p>
151:             *
152:             * @return text
153:             */
154:            public String getText() {
155:                return text;
156:            }
157:
158:            /**
159:             * <p>Set the value of the <code>text</code> property.</p>
160:             *
161:             * @param text
162:             */
163:            public void setText(String text) {
164:                this .text = text;
165:            }
166:
167:            /**
168:             * @return null
169:             */
170:            public String getFamily() {
171:                return null;
172:            }
173:
174:            /**
175:             * <p>Return the value of the <code>expanded</code> property.</p>
176:             *
177:             * @return expanded
178:             */
179:            public boolean isExpanded() {
180:                return expanded;
181:            }
182:
183:            /**
184:             * <p>Set the value of the <code>expanded</code> property.</p>
185:             *
186:             * @param isExpanded
187:             */
188:            public void setExpanded(boolean isExpanded) {
189:                this .expanded = isExpanded;
190:            }
191:
192:            /**
193:             * <p>Return the value of the <code>tooltip</code> property.</p>
194:             *
195:             * @return tootip
196:             */
197:            public String getTooltip() {
198:                return tooltip;
199:            }
200:
201:            /**
202:             * <p>Set the value of the <code>tooltip</code> property.</p>
203:             *
204:             * @param tooltipString
205:             */
206:            public void setTooltip(String tooltipString) {
207:                this .tooltip = tooltipString;
208:            }
209:
210:            /* (non-Javadoc)
211:             * @see java.lang.Object#toString()
212:             */
213:            public String toString() {
214:                return text;
215:            }
216:
217:            /**
218:             * <p>Return the value of the <code>leafIcon</code> property.</p>
219:             *
220:             * @return leafIcon
221:             */
222:            public String getLeafIcon() {
223:                return leafIcon;
224:            }
225:
226:            /**
227:             * <p>Set the value of the <code>leafIcon</code> property.</p>
228:             *
229:             * @param leafIcon
230:             */
231:            public void setLeafIcon(String leafIcon) {
232:                this .leafIcon = leafIcon;
233:            }
234:
235:            /**
236:             * <p>Return the value of the <code>branchContractedIcon</code>
237:             * property.</p>
238:             *
239:             * @return branchContractedIcon
240:             */
241:            public String getBranchContractedIcon() {
242:                return branchContractedIcon;
243:            }
244:
245:            /**
246:             * <p>Set the value of the <code>branchContractedIcon</code> property.</p>
247:             *
248:             * @param branchContractedIcon
249:             */
250:            public void setBranchContractedIcon(String branchContractedIcon) {
251:                this .branchContractedIcon = branchContractedIcon;
252:            }
253:
254:            /**
255:             * <p>Return the value of the <code>branchExpandedIcon</code> property.</p>
256:             *
257:             * @return branchExpandedIcon
258:             */
259:            public String getBranchExpandedIcon() {
260:                return branchExpandedIcon;
261:            }
262:
263:            /**
264:             * <p>Set the value of the <code>branchExpandedIcon</code> property.</p>
265:             *
266:             * @param branchExpandedIcon
267:             */
268:            public void setBranchExpandedIcon(String branchExpandedIcon) {
269:                this .branchExpandedIcon = branchExpandedIcon;
270:            }
271:
272:            /**
273:             * <p>Return the appropriate icon based on this node's leaf attribute or
274:             * expanded/collapsed state.</p> <p>By default the leaf attribute is
275:             * false.</p>
276:             *
277:             * @return String application-relative path to the image file
278:             */
279:            public String getIcon() {
280:                // leaf icon is rendered based on leaf attribute
281:                if (this .isLeaf()) {
282:                    if (leafIcon != null) {
283:                        return leafIcon;
284:                    }
285:                } else if (isExpanded()) {
286:                    if (branchExpandedIcon != null) {
287:                        return branchExpandedIcon;
288:                    }
289:                } else {
290:                    if (branchContractedIcon != null) {
291:                        return branchContractedIcon;
292:                    }
293:                }
294:                return icon;
295:            }
296:
297:            /**
298:             * <p>Return the value of the <code>wrapper</code> property.</p>
299:             *
300:             * @return wrapper
301:             */
302:            public DefaultMutableTreeNode getWrapper() {
303:                return wrapper;
304:            }
305:
306:            /**
307:             * Set the DefaultMutableTreeNode instance that wraps this instance
308:             *
309:             * @param wrapper
310:             */
311:            public void setWrapper(DefaultMutableTreeNode wrapper) {
312:                this .wrapper = wrapper;
313:            }
314:
315:            /**
316:             * <p>Return the value of the <code>action</code> property.</p>
317:             *
318:             * @return action
319:             */
320:            public String getAction() {
321:                return action;
322:            }
323:
324:            /**
325:             * <p>Set the value of the <code>action</code> property.</p>
326:             *
327:             * @param action
328:             */
329:            public void setAction(String action) {
330:                this.action = action;
331:            }
332:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.