Source Code Cross Referenced for CommandEvent.java in  » IDE-Eclipse » ui-workbench » org » eclipse » ui » commands » 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 » IDE Eclipse » ui workbench » org.eclipse.ui.commands 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*******************************************************************************
002:         * Copyright (c) 2003, 2006 IBM Corporation and others.
003:         * All rights reserved. This program and the accompanying materials
004:         * are made available under the terms of the Eclipse Public License v1.0
005:         * which accompanies this distribution, and is available at
006:         * http://www.eclipse.org/legal/epl-v10.html
007:         *
008:         * Contributors:
009:         *     IBM Corporation - initial API and implementation
010:         *******************************************************************************/package org.eclipse.ui.commands;
011:
012:        import java.util.Collections;
013:        import java.util.Map;
014:
015:        import org.eclipse.ui.internal.util.Util;
016:
017:        /**
018:         * An instance of this class describes changes to an instance of
019:         * <code>ICommand</code>.
020:         * <p>
021:         * This class is not intended to be extended by clients.
022:         * </p>
023:         * 
024:         * @since 3.0
025:         * @see ICommandListener#commandChanged(CommandEvent)
026:         * @deprecated Please use the "org.eclipse.core.commands" plug-in instead.
027:         * @see org.eclipse.core.commands.CommandEvent
028:         */
029:        public final class CommandEvent {
030:
031:            /**
032:             * Whether the attributes of the command have changed.  These are name and
033:             * value pairs representing properties of the command.
034:             */
035:            private final boolean attributeValuesByNameChanged;
036:
037:            /**
038:             * Whether the category identifier has changed.
039:             */
040:            private final boolean categoryIdChanged;
041:
042:            /**
043:             * The command that has changed; this value is never <code>null</code>.
044:             */
045:            private final ICommand command;
046:
047:            /**
048:             * Whether the defined state of the command has changed.
049:             */
050:            private final boolean definedChanged;
051:
052:            /**
053:             * Whether the description of the command has changed.
054:             */
055:            private final boolean descriptionChanged;
056:
057:            /**
058:             * Whether the command has either gained or lost a handler.
059:             */
060:            private final boolean handledChanged;
061:
062:            /**
063:             * Whether the key bindings for the command have changed.
064:             */
065:            private final boolean keySequenceBindingsChanged;
066:
067:            /**
068:             * Whether the name of the command has changed.
069:             */
070:            private final boolean nameChanged;
071:
072:            /**
073:             * The map of attributes before the change.  This is a map of attribute name
074:             * (strings) to values (any object).
075:             */
076:            private Map previousAttributeValuesByName;
077:
078:            /**
079:             * Creates a new instance of this class.
080:             * 
081:             * @param command
082:             *            the instance of the interface that changed.
083:             * @param attributeValuesByNameChanged
084:             *            true, iff the attributeValuesByName property changed.
085:             * @param categoryIdChanged
086:             *            true, iff the categoryId property changed.
087:             * @param definedChanged
088:             *            true, iff the defined property changed.
089:             * @param descriptionChanged
090:             *            true, iff the description property changed.
091:             * @param handledChanged
092:             *            true, iff the handled property changed.
093:             * @param keySequenceBindingsChanged
094:             *            true, iff the keySequenceBindings property changed.
095:             * @param nameChanged
096:             *            true, iff the name property changed.
097:             * @param previousAttributeValuesByName
098:             *            the map of previous attribute values by name. This map may be
099:             *            empty. If this map is not empty, it's collection of keys must
100:             *            only contain instances of <code>String</code>. This map
101:             *            must be <code>null</code> if attributeValuesByNameChanged is
102:             *            <code>false</code> and must not be null if
103:             *            attributeValuesByNameChanged is <code>true</code>.
104:             */
105:            public CommandEvent(ICommand command,
106:                    boolean attributeValuesByNameChanged,
107:                    boolean categoryIdChanged, boolean definedChanged,
108:                    boolean descriptionChanged, boolean handledChanged,
109:                    boolean keySequenceBindingsChanged, boolean nameChanged,
110:                    Map previousAttributeValuesByName) {
111:                if (command == null) {
112:                    throw new NullPointerException();
113:                }
114:
115:                if (!attributeValuesByNameChanged
116:                        && previousAttributeValuesByName != null) {
117:                    throw new IllegalArgumentException();
118:                }
119:
120:                if (attributeValuesByNameChanged) {
121:                    if (previousAttributeValuesByName == null) {
122:                        this .previousAttributeValuesByName = Collections.EMPTY_MAP;
123:                    } else {
124:                        this .previousAttributeValuesByName = Util.safeCopy(
125:                                previousAttributeValuesByName, String.class,
126:                                Object.class, false, true);
127:                    }
128:                }
129:
130:                this .command = command;
131:                this .attributeValuesByNameChanged = attributeValuesByNameChanged;
132:                this .categoryIdChanged = categoryIdChanged;
133:                this .definedChanged = definedChanged;
134:                this .descriptionChanged = descriptionChanged;
135:                this .handledChanged = handledChanged;
136:                this .keySequenceBindingsChanged = keySequenceBindingsChanged;
137:                this .nameChanged = nameChanged;
138:            }
139:
140:            /**
141:             * Returns the instance of the interface that changed.
142:             * 
143:             * @return the instance of the interface that changed. Guaranteed not to be
144:             *         <code>null</code>.
145:             */
146:            public ICommand getCommand() {
147:                return command;
148:            }
149:
150:            /**
151:             * Returns the map of previous attribute values by name.
152:             * 
153:             * @return the map of previous attribute values by name. This map may be
154:             *         empty. If this map is not empty, it's collection of keys is
155:             *         guaranteed to only contain instances of <code>String</code>.
156:             *         This map is guaranteed to be <code>null</code> if
157:             *         haveAttributeValuesByNameChanged() is <code>false</code> and is
158:             *         guaranteed to not be null if haveAttributeValuesByNameChanged()
159:             *         is <code>true</code>.
160:             */
161:            public Map getPreviousAttributeValuesByName() {
162:                return previousAttributeValuesByName;
163:            }
164:
165:            /**
166:             * Returns whether or not the categoryId property changed.
167:             * 
168:             * @return true, iff the categoryId property changed.
169:             */
170:            public boolean hasCategoryIdChanged() {
171:                return categoryIdChanged;
172:            }
173:
174:            /**
175:             * Returns whether or not the defined property changed.
176:             * 
177:             * @return true, iff the defined property changed.
178:             */
179:            public boolean hasDefinedChanged() {
180:                return definedChanged;
181:            }
182:
183:            /**
184:             * Returns whether or not the description property changed.
185:             * 
186:             * @return true, iff the description property changed.
187:             */
188:            public boolean hasDescriptionChanged() {
189:                return descriptionChanged;
190:            }
191:
192:            /**
193:             * Returns whether or not the handled property changed.
194:             * 
195:             * @return true, iff the handled property changed.
196:             */
197:            public boolean hasHandledChanged() {
198:                return handledChanged;
199:            }
200:
201:            /**
202:             * Returns whether or not the name property changed.
203:             * 
204:             * @return true, iff the name property changed.
205:             */
206:            public boolean hasNameChanged() {
207:                return nameChanged;
208:            }
209:
210:            /**
211:             * Returns whether or not the attributeValuesByName property changed.
212:             * 
213:             * @return true, iff the attributeValuesByName property changed.
214:             */
215:            public boolean haveAttributeValuesByNameChanged() {
216:                return attributeValuesByNameChanged;
217:            }
218:
219:            /**
220:             * Returns whether or not the keySequenceBindings property changed.
221:             * 
222:             * @return true, iff the keySequenceBindings property changed.
223:             */
224:            public boolean haveKeySequenceBindingsChanged() {
225:                return keySequenceBindingsChanged;
226:            }
227:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.