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


001:        /*******************************************************************************
002:         * Copyright (c) 2000, 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.contexts;
011:
012:        import java.util.Set;
013:
014:        import org.eclipse.ui.internal.util.Util;
015:
016:        /**
017:         * An instance of this class describes changes to an instance of
018:         * <code>IContextManager</code>.
019:         * <p>
020:         * This class is not intended to be extended by clients.
021:         * </p>
022:         * 
023:         * @since 3.0
024:         * @see IContextManagerListener#contextManagerChanged(ContextManagerEvent)
025:         * @deprecated Please use the "org.eclipse.core.commands" plug-in instead.
026:         * @see org.eclipse.core.commands.contexts.ContextManagerEvent
027:         */
028:        public final class ContextManagerEvent {
029:
030:            /**
031:             * The context manager which has changed. This value is never
032:             * <code>null</code>.
033:             */
034:            private final IContextManager contextManager;
035:
036:            /**
037:             * Whether the set of defined contexts has changed.
038:             */
039:            private final boolean definedContextIdsChanged;
040:
041:            /**
042:             * Whether the set of enabled contexts has changed.
043:             */
044:            private final boolean enabledContextIdsChanged;
045:
046:            /**
047:             * The set of context identifiers (strings) that were defined before the
048:             * change occurred. If the defined contexts did not changed, then this value
049:             * is <code>null</code>.
050:             */
051:            private final Set previouslyDefinedContextIds;
052:
053:            /**
054:             * The set of context identifiers (strings) that were enabled before the
055:             * change occurred. If the enabled contexts did not changed, then this value
056:             * is <code>null</code>.
057:             */
058:            private final Set previouslyEnabledContextIds;
059:
060:            /**
061:             * Creates a new instance of this class.
062:             * 
063:             * @param contextManager
064:             *            the instance of the interface that changed.
065:             * @param definedContextIdsChanged
066:             *            true, iff the definedContextIds property changed.
067:             * @param enabledContextIdsChanged
068:             *            true, iff the enabledContextIds property changed.
069:             * @param previouslyDefinedContextIds
070:             *            the set of identifiers to previously defined contexts. This
071:             *            set may be empty. If this set is not empty, it must only
072:             *            contain instances of <code>String</code>. This set must be
073:             *            <code>null</code> if definedContextIdsChanged is
074:             *            <code>false</code> and must not be null if
075:             *            definedContextIdsChanged is <code>true</code>.
076:             * @param previouslyEnabledContextIds
077:             *            the set of identifiers to previously enabled contexts. This
078:             *            set may be empty. If this set is not empty, it must only
079:             *            contain instances of <code>String</code>. This set must be
080:             *            <code>null</code> if enabledContextIdsChanged is
081:             *            <code>false</code> and must not be null if
082:             *            enabledContextIdsChanged is <code>true</code>.
083:             */
084:            public ContextManagerEvent(IContextManager contextManager,
085:                    boolean definedContextIdsChanged,
086:                    boolean enabledContextIdsChanged,
087:                    Set previouslyDefinedContextIds,
088:                    Set previouslyEnabledContextIds) {
089:                if (contextManager == null) {
090:                    throw new NullPointerException();
091:                }
092:
093:                if (!definedContextIdsChanged
094:                        && previouslyDefinedContextIds != null) {
095:                    throw new IllegalArgumentException();
096:                }
097:
098:                if (!enabledContextIdsChanged
099:                        && previouslyEnabledContextIds != null) {
100:                    throw new IllegalArgumentException();
101:                }
102:
103:                if (definedContextIdsChanged) {
104:                    this .previouslyDefinedContextIds = Util.safeCopy(
105:                            previouslyDefinedContextIds, String.class);
106:                } else {
107:                    this .previouslyDefinedContextIds = null;
108:                }
109:
110:                if (enabledContextIdsChanged) {
111:                    this .previouslyEnabledContextIds = Util.safeCopy(
112:                            previouslyEnabledContextIds, String.class);
113:                } else {
114:                    this .previouslyEnabledContextIds = null;
115:                }
116:
117:                this .contextManager = contextManager;
118:                this .definedContextIdsChanged = definedContextIdsChanged;
119:                this .enabledContextIdsChanged = enabledContextIdsChanged;
120:            }
121:
122:            /**
123:             * Returns the instance of the interface that changed.
124:             * 
125:             * @return the instance of the interface that changed. Guaranteed not to be
126:             *         <code>null</code>.
127:             */
128:            public IContextManager getContextManager() {
129:                return contextManager;
130:            }
131:
132:            /**
133:             * Returns the set of identifiers to previously defined contexts.
134:             * 
135:             * @return the set of identifiers to previously defined contexts. This set
136:             *         may be empty. If this set is not empty, it is guaranteed to only
137:             *         contain instances of <code>String</code>. This set is
138:             *         guaranteed to be <code>null</code> if
139:             *         haveDefinedContextIdsChanged() is <code>false</code> and is
140:             *         guaranteed to not be null if haveDefinedContextIdsChanged() is
141:             *         <code>true</code>.
142:             */
143:            public Set getPreviouslyDefinedContextIds() {
144:                return previouslyDefinedContextIds;
145:            }
146:
147:            /**
148:             * Returns the set of identifiers to previously enabled contexts.
149:             * 
150:             * @return the set of identifiers to previously enabled contexts. This set
151:             *         may be empty. If this set is not empty, it is guaranteed to only
152:             *         contain instances of <code>String</code>. This set is
153:             *         guaranteed to be <code>null</code> if
154:             *         haveEnabledContextIdsChanged() is <code>false</code> and is
155:             *         guaranteed to not be null if haveEnabledContextIdsChanged() is
156:             *         <code>true</code>.
157:             */
158:            public Set getPreviouslyEnabledContextIds() {
159:                return previouslyEnabledContextIds;
160:            }
161:
162:            /**
163:             * Returns whether or not the definedContextIds property changed.
164:             * 
165:             * @return true, iff the definedContextIds property changed.
166:             */
167:            public boolean haveDefinedContextIdsChanged() {
168:                return definedContextIdsChanged;
169:            }
170:
171:            /**
172:             * Returns whether or not the enabledContextIds property changed.
173:             * 
174:             * @return true, iff the enabledContextIds property changed.
175:             */
176:            public boolean haveEnabledContextIdsChanged() {
177:                return enabledContextIdsChanged;
178:            }
179:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.