Source Code Cross Referenced for TreeHtmlAttributeInfo.java in  » Library » Apache-beehive-1.0.2-src » org » apache » beehive » netui » tags » 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 » Library » Apache beehive 1.0.2 src » org.apache.beehive.netui.tags.tree 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Licensed to the Apache Software Foundation (ASF) under one or more
003:         * contributor license agreements.  See the NOTICE file distributed with
004:         * this work for additional information regarding copyright ownership.
005:         * The ASF licenses this file to You under the Apache License, Version 2.0
006:         * (the "License"); you may not use this file except in compliance with
007:         * the License.  You may obtain a copy of the License at
008:         *
009:         *     http://www.apache.org/licenses/LICENSE-2.0
010:         *
011:         * Unless required by applicable law or agreed to in writing, software
012:         * distributed under the License is distributed on an "AS IS" BASIS,
013:         * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014:         * See the License for the specific language governing permissions and
015:         * limitations under the License.
016:         *
017:         * $Header:$
018:         */
019:        package org.apache.beehive.netui.tags.tree;
020:
021:        /**
022:         * This structure is used to track the use of HTML attributes within a tree item.
023:         */
024:        public class TreeHtmlAttributeInfo implements  java.io.Serializable {
025:            public static final int HTML_LOCATION_DIV = 0;
026:            public static final int HTML_LOCATION_ICON = 1;
027:            public static final int HTML_LOCATION_SELECTION_LINK = 2;
028:            public static final int HTML_LOCATION_CNT = 3;
029:
030:            private static final int APPLY_TO_DESCENDENTS = 0x01;
031:            private static final int ON_ICON = 0x02;
032:            private static final int ON_SELECTION_LINK = 0x04;
033:            private static final int ON_DIV = 0x08;
034:
035:            private String _attribute;
036:            private String _value;
037:            private int state;
038:            private TreeElement _parent;
039:
040:            /**
041:             * Default constructor for creating a TreeHtmlAttributeInfo.
042:             */
043:            public TreeHtmlAttributeInfo() {
044:            }
045:
046:            /**
047:             * Construct a new TreeHtmlAttributeInfo with the specified parameters.
048:             * @param attribute the name of the attribute.
049:             * @param value sets HTML attribute value.
050:             */
051:            public TreeHtmlAttributeInfo(String attribute, String value) {
052:                setAttribute(attribute);
053:                setValue(value);
054:            }
055:
056:            /**
057:             * Return the name of the attribute.
058:             * @return the attribute name
059:             */
060:            public String getAttribute() {
061:                return _attribute;
062:            }
063:
064:            /**
065:             * Set the name of the attribute.
066:             * @param attribute the name of the attribute.
067:             */
068:            public void setAttribute(String attribute) {
069:                _attribute = attribute;
070:            }
071:
072:            /**
073:             * Return the value of the attribute.
074:             * @return the String value of the attribute.
075:             */
076:            public String getValue() {
077:                return _value;
078:            }
079:
080:            /**
081:             * Set the HTML attribute value.
082:             * @param value the value of the HTML attribute.
083:             */
084:            public void setValue(String value) {
085:                _value = value;
086:            }
087:
088:            /**
089:             * Return the parent node of the HtmlAttributeInfo item.
090:             * This is the node the HtmlAttributeInfo item is associated with.
091:             * @return the TreeElement parent.
092:             */
093:            public TreeElement getParent() {
094:                return _parent;
095:            }
096:
097:            /**
098:             * Set the parent of the HtmlAttributeInfo item.
099:             * This sets the node the HtmlAttributeInfo item will be associated with.
100:             * @param parent the TreeElement parent.
101:             */
102:            public void setParent(TreeElement parent) {
103:                _parent = parent;
104:            }
105:
106:            /**
107:             * Gets whether the attribute is applied to descendants of the node.
108:             * @return whether the attribute is applied to descendants of the node.
109:             */
110:            public boolean isApplyToDescendents() {
111:                return ((state & APPLY_TO_DESCENDENTS) != 0);
112:            }
113:
114:            /**
115:             * Sets whether the attribute is applied to descendant nodes of the parent node.
116:             * @param applyToDescendents
117:             */
118:            public void setApplyToDescendents(boolean applyToDescendents) {
119:                if (applyToDescendents)
120:                    state = state | APPLY_TO_DESCENDENTS;
121:                else
122:                    state = state & (-1 ^ APPLY_TO_DESCENDENTS);
123:
124:            }
125:
126:            /**
127:             * Gets whether the HTML attribute is on the <div> tag of the node.
128:             * @return whether the attribute is on the <div> tag of the node.
129:             */
130:            public boolean isOnDiv() {
131:                return ((state & ON_DIV) != 0);
132:            }
133:
134:            /**
135:             * Sets whether the HTML attribute is on the node item's <div> tag.
136:             * @param onDiv whether the attribute is on the <div> tag of the node.
137:             */
138:            public void setOnDiv(boolean onDiv) {
139:                if (onDiv)
140:                    state = state | ON_DIV;
141:                else
142:                    state = state & (-1 ^ ON_DIV);
143:
144:            }
145:
146:            /**
147:             * Gets whether the HTML attribute is on the <img> tag for the icon of the node.
148:             * @return whether the attribute is on the <img> tag of the node.
149:             */
150:            public boolean isOnIcon() {
151:                return ((state & ON_ICON) != 0);
152:            }
153:
154:            /**
155:             * Sets whether the HTML attribute is on the node item's <img> tag for the icon.
156:             * @param onIcon whether the attribute is on the <img> tag of the node.
157:             */
158:            public void setOnIcon(boolean onIcon) {
159:                if (onIcon)
160:                    state = state | ON_ICON;
161:                else
162:                    state = state & (-1 ^ ON_ICON);
163:
164:            }
165:
166:            /**
167:             * Gets whether the HTML attribute is on the selection link of the node.
168:             * @return whether the attribute is on the selection link of the node.
169:             */
170:            public boolean isOnSelectionLink() {
171:                return ((state & ON_SELECTION_LINK) != 0);
172:            }
173:
174:            /**
175:             * Sets whether the HTML attribute is on the node item's selection.
176:             * @param onSelectionLink whether the attribute is on the selection link of the node.
177:             */
178:            public void setOnSelectionLink(boolean onSelectionLink) {
179:                if (onSelectionLink)
180:                    state = state | ON_SELECTION_LINK;
181:                else
182:                    state = state & (-1 ^ ON_SELECTION_LINK);
183:            }
184:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.