Source Code Cross Referenced for SummaryData.java in  » GIS » udig-1.1 » net » refractions » udig » project » ui » summary » 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 » GIS » udig 1.1 » net.refractions.udig.project.ui.summary 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /* uDig - User Friendly Desktop Internet GIS client
002:         * http://udig.refractions.net
003:         * (C) 2004, Refractions Research Inc.
004:         *
005:         * This library is free software; you can redistribute it and/or
006:         * modify it under the terms of the GNU Lesser General Public
007:         * License as published by the Free Software Foundation;
008:         * version 2.1 of the License.
009:         *
010:         * This library is distributed in the hope that it will be useful,
011:         * but WITHOUT ANY WARRANTY; without even the implied warranty of
012:         * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
013:         * Lesser General Public License for more details.
014:         */
015:        package net.refractions.udig.project.ui.summary;
016:
017:        import org.eclipse.jface.viewers.ICellEditorValidator;
018:        import org.eclipse.jface.viewers.ICellModifier;
019:        import org.eclipse.jface.viewers.TextCellEditor;
020:
021:        /**
022:         * Simple data object that has title and information fields.  If the modifier is set then the data can be edited. Th cell editor 
023:         * is always a {@link TextCellEditor} so the modifier should aways return a string.  The validator by default always accept 
024:         * the result.  For custom validation cell validator can be set.
025:         * @author Jesse
026:         * @since 1.1.0
027:         */
028:        public class SummaryData {
029:            private static final ICellModifier DEFAULT_MODIFIER = new ICellModifier() {
030:
031:                public boolean canModify(Object element, String property) {
032:                    return false;
033:                }
034:
035:                public Object getValue(Object element, String property) {
036:                    return null;
037:                }
038:
039:                public void modify(Object element, String property, Object value) {
040:                }
041:
042:            };
043:            private static final ICellEditorValidator TRUE_VALIDATOR = new ICellEditorValidator() {
044:
045:                public String isValid(Object value) {
046:                    return null;
047:                }
048:
049:            };
050:            private String title;
051:            private String info;
052:            private ICellModifier modifier = DEFAULT_MODIFIER;
053:            private ICellEditorValidator validator = TRUE_VALIDATOR;
054:            private SummaryData[] children;
055:            private SummaryData parent;
056:
057:            /**
058:             * new instance. data has no children and no parent and is not editable
059:             * @param title title/property name of the data item
060:             * @param info the information to display.  toString is called on the item to display it.
061:             * 
062:             */
063:            public SummaryData(String title, Object info) {
064:                this .title = title;
065:                if (info != null)
066:                    this .info = info.toString();
067:            }
068:
069:            public String getInfo() {
070:                return info;
071:            }
072:
073:            public void setInfo(String info) {
074:                this .info = info;
075:            }
076:
077:            public String getTitle() {
078:                return title;
079:            }
080:
081:            public void setTitle(String title) {
082:                this .title = title;
083:            }
084:
085:            /**
086:             * gets the items to display as children of this object
087:             *
088:             * @return the items to display as children of this object
089:             */
090:            public SummaryData[] getChildren() {
091:                if (children == null)
092:                    return new SummaryData[0];
093:
094:                SummaryData[] data = new SummaryData[children.length];
095:                System.arraycopy(children, 0, data, 0, data.length);
096:                return data;
097:            }
098:
099:            public void setChildren(SummaryData[] children) {
100:                SummaryData[] data;
101:                if (children == null) {
102:                    data = new SummaryData[0];
103:                } else {
104:                    data = new SummaryData[children.length];
105:                    System.arraycopy(children, 0, data, 0, data.length);
106:                }
107:
108:                this .children = data;
109:            }
110:
111:            /**
112:             * @return the cell modifier that can edit this data.  
113:             */
114:            public ICellModifier getModifier() {
115:                return modifier;
116:            }
117:
118:            /**
119:             * Sets the cell modifier used for this data item.  The property can be ignored and the element will always be 
120:             * the {@link SummaryData} object.  The newValue passed to the modify methods will always be a String
121:             *
122:             * @param modifier
123:             */
124:            public void setModifier(ICellModifier modifier) {
125:                if (modifier == null) {
126:                    throw new NullPointerException();
127:                }
128:                this .modifier = modifier;
129:            }
130:
131:            public ICellEditorValidator getValidator() {
132:                return validator;
133:            }
134:
135:            public void setValidator(ICellEditorValidator validator) {
136:                if (validator == null) {
137:                    throw new NullPointerException();
138:                }
139:
140:                this .validator = validator;
141:            }
142:
143:            public SummaryData getParent() {
144:                return parent;
145:            }
146:
147:            public void setParent(SummaryData parent) {
148:                this.parent = parent;
149:            }
150:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.