Source Code Cross Referenced for PropertyGroup.java in  » Swing-Library » InfoNode-Docking-Windows » net » infonode » properties » base » 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 » Swing Library » InfoNode Docking Windows » net.infonode.properties.base 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Copyright (C) 2004 NNL Technology AB
003:         * Visit www.infonode.net for information about InfoNode(R) 
004:         * products and how to contact NNL Technology AB.
005:         *
006:         * This program is free software; you can redistribute it and/or
007:         * modify it under the terms of the GNU General Public License
008:         * as published by the Free Software Foundation; either version 2
009:         * of the License, or (at your option) any later version.
010:         *
011:         * This program is distributed in the hope that it will be useful,
012:         * but WITHOUT ANY WARRANTY; without even the implied warranty of
013:         * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
014:         * GNU General Public License for more details.
015:         *
016:         * You should have received a copy of the GNU General Public License
017:         * along with this program; if not, write to the Free Software
018:         * Foundation, Inc., 59 Temple Place - Suite 330, Boston, 
019:         * MA 02111-1307, USA.
020:         */
021:
022:        // $Id: PropertyGroup.java,v 1.6 2004/09/22 14:32:50 jesper Exp $
023:        package net.infonode.properties.base;
024:
025:        import java.util.ArrayList;
026:
027:        /**
028:         * A group of properties. The group have a name and a description. It can also have a super group from which it inherit
029:         * all it's properties. You can think of a property group as similar to a Java class, and properties similar to class
030:         * fields.
031:         *
032:         * @author $Author: jesper $
033:         * @version $Revision: 1.6 $
034:         */
035:        public class PropertyGroup {
036:            private PropertyGroup super Group;
037:            private String name;
038:            private String description;
039:            private ArrayList properties = new ArrayList(10);
040:
041:            /**
042:             * Creates a property group.
043:             *
044:             * @param name        the name of the group
045:             * @param description the group description
046:             */
047:            public PropertyGroup(String name, String description) {
048:                this .name = name;
049:                this .description = description;
050:            }
051:
052:            /**
053:             * Creates a property group with a super group.
054:             * All properties in the super group will be inherited to this group.
055:             *
056:             * @param superGroup  the super group of this group
057:             * @param name        the name of the group
058:             * @param description the group description
059:             */
060:            public PropertyGroup(PropertyGroup super Group, String name,
061:                    String description) {
062:                this (name, description);
063:                this .super Group = super Group;
064:            }
065:
066:            /**
067:             * Returns the super group of this group.
068:             *
069:             * @return the super group of this group, null if it has no super group
070:             */
071:            public PropertyGroup getSuperGroup() {
072:                return super Group;
073:            }
074:
075:            /**
076:             * Returns the description for this group.
077:             *
078:             * @return the description for this group
079:             */
080:            public String getDescription() {
081:                return description;
082:            }
083:
084:            /**
085:             * Returns the name of this group.
086:             *
087:             * @return the name of this group
088:             */
089:            public String getName() {
090:                return name;
091:            }
092:
093:            /**
094:             * Add a property to this group.
095:             *
096:             * @param property the property to add
097:             */
098:            public void addProperty(Property property) {
099:                properties.add(property);
100:            }
101:
102:            /**
103:             * Returns the number of properties in this group.
104:             * This does not include properties in super groups.
105:             *
106:             * @return the number of properties in this group
107:             */
108:            public int getPropertyCount() {
109:                return properties.size();
110:            }
111:
112:            /**
113:             * Returns true if this group or one of it's super groups contains the property.
114:             *
115:             * @param property the property
116:             * @return true if this group or one of it's super groups contains the property
117:             */
118:            public boolean hasProperty(Property property) {
119:                return isA(property.getGroup());
120:            }
121:
122:            /**
123:             * Returns the property at the index,
124:             * This does not include properties in super groups.
125:             *
126:             * @param index the property index
127:             * @return the property at the index
128:             */
129:            public Property getProperty(int index) {
130:                return (Property) properties.get(index);
131:            }
132:
133:            /**
134:             * Returns an array with the properties in this group.
135:             * This does not include properties in super groups.
136:             *
137:             * @return an array with the properties in this group
138:             */
139:            public Property[] getProperties() {
140:                return (Property[]) properties.toArray(new Property[properties
141:                        .size()]);
142:            }
143:
144:            public String toString() {
145:                return getName();
146:            }
147:
148:            /**
149:             * Returns the property with the given name.
150:             * This includes properties in super groups.
151:             *
152:             * @param name the property name
153:             * @return the property with the given name, null if no property was found
154:             */
155:            public Property getProperty(String name) {
156:                for (int i = 0; i < getPropertyCount(); i++) {
157:                    if (getProperty(i).getName().equals(name))
158:                        return getProperty(i);
159:                }
160:
161:                return super Group == null ? null : super Group.getProperty(name);
162:            }
163:
164:            /**
165:             * Returns true if the group is this group or one of it's super groups.
166:             *
167:             * @param group the group
168:             * @return true if the group is this group or one of it's super groups
169:             */
170:            private boolean isA(PropertyGroup group) {
171:                return group == this
172:                        || (getSuperGroup() != null && getSuperGroup().isA(
173:                                group));
174:            }
175:
176:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.