Source Code Cross Referenced for Category.java in  » Report » pentaho-report » org » pentaho » reportdesigner » lib » client » components » 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 » pentaho report » org.pentaho.reportdesigner.lib.client.components 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Copyright 2006-2007 Pentaho Corporation.  All rights reserved.
003:         * This software was developed by Pentaho Corporation and is provided under the terms
004:         * of the Mozilla Public License, Version 1.1, or any later version. You may not use
005:         * this file except in compliance with the license. If you need a copy of the license,
006:         * please go to http://www.mozilla.org/MPL/MPL-1.1.txt.
007:         *
008:         * Software distributed under the Mozilla Public License is distributed on an "AS IS"
009:         * basis, WITHOUT WARRANTY OF ANY KIND, either express or  implied. Please refer to
010:         * the license for the specific language governing your rights and limitations.
011:         *
012:         * Additional Contributor(s): Martin Schmid gridvision engineering GmbH
013:         */
014:        package org.pentaho.reportdesigner.lib.client.components;
015:
016:        import org.jetbrains.annotations.NonNls;
017:        import org.jetbrains.annotations.NotNull;
018:        import org.jetbrains.annotations.Nullable;
019:        import org.pentaho.reportdesigner.lib.client.commands.CommandToolBar;
020:
021:        import javax.swing.*;
022:        import java.beans.PropertyChangeListener;
023:        import java.beans.PropertyChangeSupport;
024:
025:        /**
026:         * User: Martin
027:         * Date: 11.03.2005
028:         * Time: 10:11:41
029:         */
030:        public class Category<T extends JComponent> {
031:            @NotNull
032:            private Object key;
033:            @Nullable
034:            private ImageIcon iconBig;
035:            @Nullable
036:            private ImageIcon iconSmall;
037:            @NotNull
038:            private String title;
039:            @NotNull
040:            private JComponent[] actionComponents;
041:            @Nullable
042:            private T mainComponent;
043:
044:            private long lastAccessedMillis;
045:
046:            @NotNull
047:            private PropertyChangeSupport propertyChangeSupport;
048:
049:            @Nullable
050:            private JToolBar jToolBar;
051:
052:            @Nullable
053:            @SuppressWarnings({"UnusedDeclaration"})
054:            private CommandToolBar commandToolBar;
055:            @NotNull
056:            private static final JComponent[] EMPTY_JCOMPONENT_ARRAY = new JComponent[0];
057:
058:            public Category(@NotNull
059:            @NonNls
060:            Object key, @Nullable
061:            ImageIcon iconBig, @Nullable
062:            ImageIcon iconSmall, @NotNull
063:            String title, @Nullable
064:            T mainComponent) {
065:                //noinspection ConstantConditions
066:                if (key == null) {
067:                    throw new IllegalArgumentException("key must not be null");
068:                }
069:
070:                this .key = key;
071:                this .iconBig = iconBig;
072:                this .iconSmall = iconSmall;
073:                this .title = title;
074:                this .actionComponents = EMPTY_JCOMPONENT_ARRAY;
075:                this .mainComponent = mainComponent;
076:
077:                propertyChangeSupport = new PropertyChangeSupport(this );
078:            }
079:
080:            @NotNull
081:            public Object getKey() {
082:                return key;
083:            }
084:
085:            @Nullable
086:            public ImageIcon getIconBig() {
087:                return iconBig;
088:            }
089:
090:            public void setIconBig(@Nullable
091:            ImageIcon iconBig) {
092:                ImageIcon oldIconBig = this .iconBig;
093:                this .iconBig = iconBig;
094:
095:                propertyChangeSupport.firePropertyChange("iconBig", oldIconBig,
096:                        iconBig);//NON-NLS
097:            }
098:
099:            @Nullable
100:            public ImageIcon getIconSmall() {
101:                return iconSmall;
102:            }
103:
104:            public void setIconSmall(@Nullable
105:            ImageIcon iconSmall) {
106:                ImageIcon oldIconSmall = this .iconSmall;
107:                this .iconSmall = iconSmall;
108:
109:                propertyChangeSupport.firePropertyChange("iconSmall",
110:                        oldIconSmall, iconSmall);//NON-NLS
111:            }
112:
113:            @NotNull
114:            public String getTitle() {
115:                return title;
116:            }
117:
118:            public void setTitle(@NotNull
119:            String title) {
120:                String oldTitle = this .title;
121:                this .title = title;
122:
123:                propertyChangeSupport.firePropertyChange("title", oldTitle,
124:                        title);//NON-NLS
125:            }
126:
127:            @NotNull
128:            public JComponent[] getActionComponents() {
129:                return actionComponents;
130:            }
131:
132:            public void setActionComponents(@NotNull
133:            JComponent[] actionComponents) {
134:                JComponent[] oldActionComponents = this .actionComponents;
135:                this .actionComponents = actionComponents;
136:
137:                propertyChangeSupport.firePropertyChange("actionComponents",
138:                        oldActionComponents, actionComponents);//NON-NLS
139:            }
140:
141:            @Nullable
142:            public JToolBar getToolBar() {
143:                return jToolBar;
144:            }
145:
146:            public void setToolBar(@NotNull
147:            JToolBar jToolBar) {
148:                JToolBar oldToolBar = this .jToolBar;
149:                this .jToolBar = jToolBar;
150:
151:                propertyChangeSupport.firePropertyChange("toolBar", oldToolBar,
152:                        jToolBar);//NON-NLS
153:            }
154:
155:            public void setToolBar(@NotNull
156:            CommandToolBar commandToolBar) {
157:                this .commandToolBar = commandToolBar;
158:                JToolBar oldToolBar = this .jToolBar;
159:                this .jToolBar = commandToolBar.getToolBar();
160:
161:                propertyChangeSupport.firePropertyChange("toolBar", oldToolBar,
162:                        jToolBar);//NON-NLS
163:            }
164:
165:            @Nullable
166:            public T getMainComponent() {
167:                return mainComponent;
168:            }
169:
170:            public void setMainComponent(@Nullable
171:            T mainComponent) {
172:                JComponent oldMainComponent = this .mainComponent;
173:                this .mainComponent = mainComponent;
174:
175:                propertyChangeSupport.firePropertyChange("mainComponent",
176:                        oldMainComponent, mainComponent);//NON-NLS
177:            }
178:
179:            public long getLastAccessedMillis() {
180:                return lastAccessedMillis;
181:            }
182:
183:            public void setLastAccessedMillis(long lastAccessedMillis) {
184:                long oldLastAccessedMillis = this .lastAccessedMillis;
185:                this .lastAccessedMillis = lastAccessedMillis;
186:
187:                propertyChangeSupport.firePropertyChange("lastAccessedMillis",
188:                        Long.valueOf(oldLastAccessedMillis), Long
189:                                .valueOf(lastAccessedMillis));//NON-NLS
190:            }
191:
192:            public void addPropertyChangeListener(@NotNull
193:            PropertyChangeListener listener) {
194:                propertyChangeSupport.addPropertyChangeListener(listener);
195:            }
196:
197:            public void removePropertyChangeListener(@NotNull
198:            PropertyChangeListener listener) {
199:                propertyChangeSupport.removePropertyChangeListener(listener);
200:            }
201:
202:            @NotNull
203:            public PropertyChangeListener[] getPropertyChangeListeners() {
204:                return propertyChangeSupport.getPropertyChangeListeners();
205:            }
206:
207:            public void addPropertyChangeListener(@NotNull
208:            String propertyName, @NotNull
209:            PropertyChangeListener listener) {
210:                propertyChangeSupport.addPropertyChangeListener(propertyName,
211:                        listener);
212:            }
213:
214:            public void removePropertyChangeListener(@NotNull
215:            String propertyName, @NotNull
216:            PropertyChangeListener listener) {
217:                propertyChangeSupport.removePropertyChangeListener(
218:                        propertyName, listener);
219:            }
220:
221:            @NotNull
222:            public PropertyChangeListener[] getPropertyChangeListeners(@NotNull
223:            String propertyName) {
224:                return propertyChangeSupport
225:                        .getPropertyChangeListeners(propertyName);
226:            }
227:
228:            public boolean equals(@Nullable
229:            Object o) {
230:                if (this  == o)
231:                    return true;
232:                if (!(o instanceof  Category))
233:                    return false;
234:
235:                final Category<?> category = (Category<?>) o;
236:
237:                return key.equals(category.key);
238:            }
239:
240:            public int hashCode() {
241:                return (key.hashCode());
242:            }
243:
244:            @NotNull
245:            public String toString() {
246:                return "Category{" + "key=" + key + ", title='" + title + "'"
247:                        + ", mainComponent=" + mainComponent + "}";
248:            }
249:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.