Source Code Cross Referenced for UserColumnField.java in  » Report » datavision-1.1.0 » jimm » datavision » field » 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 » Report » datavision 1.1.0 » jimm.datavision.field 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        package jimm.datavision.field;
002:
003:        import jimm.datavision.*;
004:        import jimm.datavision.gui.FieldWidget;
005:        import jimm.datavision.gui.UserColumnWidget;
006:        import jimm.datavision.gui.SectionWidget;
007:        import java.util.Collection;
008:        import java.util.Observer;
009:        import java.util.Observable;
010:
011:        /**
012:         * A user column field represents a user column, which in turn holds some SQL
013:         * that is put in the SELECT clause of a query. The value of a user column
014:         * field holds a {@link UserColumn} object. (In the XML, the user column
015:         * field's value is the id of the user column.)
016:         *
017:         * @author Jim Menard, <a href="mailto:jimm@io.com">jimm@io.com</a>
018:         */
019:        public class UserColumnField extends Field implements  Observer {
020:
021:            protected UserColumn usercol;
022:
023:            /**
024:             * Constructs a user column field with the specified id in the specified report
025:             * section whose {@link UserColumn}'s id is <var>value</var>.
026:             *
027:             * @param id the new field's id
028:             * @param report the report containing this element
029:             * @param section the report section in which the field resides
030:             * @param value the id of a user column
031:             * @param visible show/hide flag
032:             */
033:            public UserColumnField(Long id, Report report, Section section,
034:                    Object value, boolean visible) {
035:                super (id, report, section, value, visible);
036:                usercol = report.findUserColumn(value);
037:                usercol.addObserver(this );
038:            }
039:
040:            protected void finalize() throws Throwable {
041:                usercol.deleteObserver(this );
042:                super .finalize();
043:            }
044:
045:            public void update(Observable o, Object arg) {
046:                setChanged();
047:                notifyObservers(arg);
048:            }
049:
050:            public FieldWidget makeWidget(SectionWidget sw) {
051:                return new UserColumnWidget(sw, this );
052:            }
053:
054:            /**
055:             * Not really used; we drag user columns, not user column fields.
056:             */
057:            public String dragString() {
058:                return typeString() + ":" + usercol.getId();
059:            }
060:
061:            /**
062:             * Returns the user column.
063:             *
064:             * @return the user column
065:             */
066:            public UserColumn getUserColumn() {
067:                return usercol;
068:            }
069:
070:            /**
071:             * Sets the user column.
072:             *
073:             * @param newUsercol the new user column
074:             */
075:            public void setUserColumn(UserColumn newUsercol) {
076:                if (usercol != newUsercol) {
077:                    usercol.deleteObserver(this );
078:                    usercol = newUsercol;
079:                    usercol.addObserver(this );
080:                    setChanged();
081:                    notifyObservers();
082:                }
083:            }
084:
085:            public String typeString() {
086:                return "usercol";
087:            }
088:
089:            public String designLabel() {
090:                return usercol.designLabel();
091:            }
092:
093:            public String formulaString() {
094:                return usercol.formulaString();
095:            }
096:
097:            public boolean refersTo(Field f) {
098:                return usercol.refersTo(f);
099:            }
100:
101:            public boolean refersTo(Parameter p) {
102:                return usercol.refersTo(p);
103:            }
104:
105:            /**
106:             * This override returns <code>true</code> if this user column is in a
107:             * detail section. We don't really know that this user column returns
108:             * a number, so we'll err on the side of allowing aggregation.
109:             *
110:             * @return <code>true</code> if this field can be aggregated
111:             */
112:            public boolean canBeAggregated() {
113:                // Section can be null during dragging.
114:                return section != null && section.isDetail();
115:            }
116:
117:            /**
118:             * Returns the value of this field. For user column fields, this is the
119:             * value generated by evaluating the {@link UserColumn}.
120:             *
121:             * @return the result of evaluating the usercol
122:             */
123:            public Object getValue() {
124:                return getReport().columnValue(usercol);
125:            }
126:
127:            /**
128:             * Returns a collection of the columns used in the user column. This is used
129:             * by the report's query when it is figuring out what columns and tables
130:             * are used by the report. Calls {@link UserColumn#columnsUsed}.
131:             *
132:             * @see jimm.datavision.source.Query#findSelectablesUsed
133:             */
134:            public Collection columnsUsed() {
135:                return usercol.columnsUsed();
136:            }
137:
138:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.