Source Code Cross Referenced for DispatchHelper.java in  » IDE-Netbeans » uml » org » netbeans » modules » uml » ui » support » 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 Netbeans » uml » org.netbeans.modules.uml.ui.support 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


0001:        /*
0002:         * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
0003:         *
0004:         * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
0005:         *
0006:         * The contents of this file are subject to the terms of either the GNU
0007:         * General Public License Version 2 only ("GPL") or the Common
0008:         * Development and Distribution License("CDDL") (collectively, the
0009:         * "License"). You may not use this file except in compliance with the
0010:         * License. You can obtain a copy of the License at
0011:         * http://www.netbeans.org/cddl-gplv2.html
0012:         * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
0013:         * specific language governing permissions and limitations under the
0014:         * License.  When distributing the software, include this License Header
0015:         * Notice in each file and include the License file at
0016:         * nbbuild/licenses/CDDL-GPL-2-CP.  Sun designates this
0017:         * particular file as subject to the "Classpath" exception as provided
0018:         * by Sun in the GPL Version 2 section of the License file that
0019:         * accompanied this code. If applicable, add the following below the
0020:         * License Header, with the fields enclosed by brackets [] replaced by
0021:         * your own identifying information:
0022:         * "Portions Copyrighted [year] [name of copyright owner]"
0023:         *
0024:         * Contributor(s):
0025:         *
0026:         * The Original Software is NetBeans. The Initial Developer of the Original
0027:         * Software is Sun Microsystems, Inc. Portions Copyright 1997-2007 Sun
0028:         * Microsystems, Inc. All Rights Reserved.
0029:         *
0030:         * If you wish your version of this file to be governed by only the CDDL
0031:         * or only the GPL Version 2, indicate your decision by adding
0032:         * "[Contributor] elects to include this software in this distribution
0033:         * under the [CDDL or GPL Version 2] license." If you do not indicate a
0034:         * single choice of license, a recipient has the option to distribute
0035:         * your version of this file under either the CDDL, the GPL Version 2 or
0036:         * to extend the choice of license to its licensees as provided above.
0037:         * However, if you add GPL Version 2 code and therefore, elected the GPL
0038:         * Version 2 license, then the option applies only if the new code is
0039:         * made subject to such option by the copyright holder.
0040:         */
0041:
0042:        /*
0043:         *
0044:         * Created on May 30, 2003
0045:         * @author Trey Spiva
0046:         */
0047:        package org.netbeans.modules.uml.ui.support;
0048:
0049:        import java.util.HashMap;
0050:
0051:        //import org.netbeans.modules.uml.core.addinframework.IAddInEventsSink;
0052:        import org.netbeans.modules.uml.core.coreapplication.ICoreProduct;
0053:        import org.netbeans.modules.uml.core.coreapplication.ICoreProductEventDispatcher;
0054:        import org.netbeans.modules.uml.core.coreapplication.ICoreProductInitEventsSink;
0055:        import org.netbeans.modules.uml.core.eventframework.EventDispatchNameKeeper;
0056:        import org.netbeans.modules.uml.core.eventframework.IEventDispatchController;
0057:        import org.netbeans.modules.uml.core.eventframework.IEventDispatcher;
0058:        import org.netbeans.modules.uml.core.eventframework.IEventFrameworkEventsSink;
0059:        import org.netbeans.modules.uml.core.metamodel.common.commonactivities.IActivityEdgeEventsSink;
0060:        import org.netbeans.modules.uml.core.metamodel.common.commonactivities.IActivityEventDispatcher;
0061:        import org.netbeans.modules.uml.core.metamodel.core.foundation.IDocumentationModifiedEventsSink;
0062:        import org.netbeans.modules.uml.core.metamodel.core.foundation.IElementChangeEventDispatcher;
0063:        import org.netbeans.modules.uml.core.metamodel.core.foundation.IElementDisposalEventsSink;
0064:        import org.netbeans.modules.uml.core.metamodel.core.foundation.IElementLifeTimeEventDispatcher;
0065:        import org.netbeans.modules.uml.core.metamodel.core.foundation.IElementLifeTimeEventsSink;
0066:        import org.netbeans.modules.uml.core.metamodel.core.foundation.IElementModifiedEventsSink;
0067:        import org.netbeans.modules.uml.core.metamodel.core.foundation.IExternalElementEventsSink;
0068:        import org.netbeans.modules.uml.core.metamodel.core.foundation.IMetaAttributeModifiedEventsSink;
0069:        import org.netbeans.modules.uml.core.metamodel.core.foundation.INamedElementEventsSink;
0070:        import org.netbeans.modules.uml.core.metamodel.core.foundation.INamespaceModifiedEventsSink;
0071:        import org.netbeans.modules.uml.core.metamodel.core.foundation.IPackageEventsSink;
0072:        import org.netbeans.modules.uml.core.metamodel.core.foundation.IRedefinableElementModifiedEventsSink;
0073:        import org.netbeans.modules.uml.core.metamodel.core.foundation.IRelationEventsSink;
0074:        import org.netbeans.modules.uml.core.metamodel.core.foundation.IRelationValidatorEventDispatcher;
0075:        import org.netbeans.modules.uml.core.metamodel.core.foundation.IRelationValidatorEventsSink;
0076:        import org.netbeans.modules.uml.core.metamodel.core.foundation.IStereotypeEventsSink;
0077:        import org.netbeans.modules.uml.core.metamodel.core.foundation.IUnknownClassifierEventsSink;
0078:        import org.netbeans.modules.uml.core.metamodel.dynamics.IDynamicsEventDispatcher;
0079:        import org.netbeans.modules.uml.core.metamodel.dynamics.ILifelineModifiedEventsSink;
0080:        import org.netbeans.modules.uml.core.metamodel.infrastructure.coreinfrastructure.IAffectedElementEventsSink;
0081:        import org.netbeans.modules.uml.core.metamodel.infrastructure.coreinfrastructure.IAssociationEndEventsSink;
0082:        import org.netbeans.modules.uml.core.metamodel.infrastructure.coreinfrastructure.IAttributeEventsSink;
0083:        import org.netbeans.modules.uml.core.metamodel.infrastructure.coreinfrastructure.IBehavioralFeatureEventsSink;
0084:        import org.netbeans.modules.uml.core.metamodel.infrastructure.coreinfrastructure.IClassifierEventDispatcher;
0085:        import org.netbeans.modules.uml.core.metamodel.infrastructure.coreinfrastructure.IClassifierFeatureEventsSink;
0086:        import org.netbeans.modules.uml.core.metamodel.infrastructure.coreinfrastructure.IClassifierTransformEventsSink;
0087:        import org.netbeans.modules.uml.core.metamodel.infrastructure.coreinfrastructure.IFeatureEventsSink;
0088:        import org.netbeans.modules.uml.core.metamodel.infrastructure.coreinfrastructure.IOperationEventsSink;
0089:        import org.netbeans.modules.uml.core.metamodel.infrastructure.coreinfrastructure.IParameterEventsSink;
0090:        import org.netbeans.modules.uml.core.metamodel.infrastructure.coreinfrastructure.IStructuralFeatureEventsSink;
0091:        import org.netbeans.modules.uml.core.metamodel.infrastructure.coreinfrastructure.ITypedElementEventsSink;
0092:        import org.netbeans.modules.uml.core.metamodel.structure.IArtifactEventsSink;
0093:        import org.netbeans.modules.uml.core.metamodel.structure.IProjectEventsSink;
0094:        import org.netbeans.modules.uml.core.metamodel.structure.IStructureEventDispatcher;
0095:        import org.netbeans.modules.uml.core.preferenceframework.IPreferenceManagerEventDispatcher;
0096:        import org.netbeans.modules.uml.core.preferenceframework.IPreferenceManagerEventsSink;
0097:        import org.netbeans.modules.uml.core.preferenceframework.PreferenceManagerEventDispatcher;
0098:        import org.netbeans.modules.uml.core.roundtripframework.IRequestProcessorInitEventsSink;
0099:        import org.netbeans.modules.uml.core.roundtripframework.IRoundTripAttributeEventsSink;
0100:        import org.netbeans.modules.uml.core.roundtripframework.IRoundTripClassEventsSink;
0101:        import org.netbeans.modules.uml.core.roundtripframework.IRoundTripOperationEventsSink;
0102:        import org.netbeans.modules.uml.core.roundtripframework.IRoundTripPackageEventsSink;
0103:        import org.netbeans.modules.uml.core.roundtripframework.IRoundTripRelationEventsSink;
0104:        import org.netbeans.modules.uml.core.support.umlmessagingcore.IMessengerEventsSink;
0105:        import org.netbeans.modules.uml.core.support.umlsupport.ProductRetriever;
0106:        import org.netbeans.modules.uml.core.support.umlutils.InvalidArguments;
0107:        import org.netbeans.modules.uml.core.workspacemanagement.IWSElementEventsSink;
0108:        import org.netbeans.modules.uml.core.workspacemanagement.IWSElementModifiedEventsSink;
0109:        import org.netbeans.modules.uml.core.workspacemanagement.IWSProjectEventsSink;
0110:        import org.netbeans.modules.uml.core.workspacemanagement.IWorkspaceEventDispatcher;
0111:        import org.netbeans.modules.uml.core.workspacemanagement.IWorkspaceEventsSink;
0112:        import org.netbeans.modules.uml.ui.controls.drawingarea.DrawingAreaEventDispatcherImpl;
0113:        import org.netbeans.modules.uml.ui.controls.drawingarea.IDrawingAreaEventDispatcher;
0114:        import org.netbeans.modules.uml.ui.controls.editcontrol.EditControlEventDispatcher;
0115:        import org.netbeans.modules.uml.ui.controls.editcontrol.IEditControlEventDispatcher;
0116:        import org.netbeans.modules.uml.ui.controls.editcontrol.IEditControlEventSink;
0117:        import org.netbeans.modules.uml.ui.controls.filter.IProjectTreeFilterDialogEventDispatcher;
0118:        import org.netbeans.modules.uml.ui.controls.filter.IProjectTreeFilterDialogEventsSink;
0119:        import org.netbeans.modules.uml.ui.controls.filter.ProjectTreeFilterDialogEventDispatcher;
0120:        import org.netbeans.modules.uml.ui.controls.projecttree.IProjectTreeContextMenuEventsSink;
0121:        import org.netbeans.modules.uml.ui.controls.projecttree.IProjectTreeEventDispatcher;
0122:        import org.netbeans.modules.uml.ui.controls.projecttree.IProjectTreeEventsSink;
0123:        import org.netbeans.modules.uml.ui.controls.projecttree.ProjectTreeEventDispatcherImpl;
0124:        import org.netbeans.modules.uml.core.scm.ISCMEventDispatcher;
0125:        import org.netbeans.modules.uml.core.scm.ISCMEventsSink;
0126:        import org.netbeans.modules.uml.ui.swing.drawingarea.IChangeNotificationTranslatorSink;
0127:        import org.netbeans.modules.uml.ui.swing.drawingarea.ICompartmentEventsSink;
0128:        import org.netbeans.modules.uml.ui.swing.drawingarea.IDrawingAreaAddEdgeEventsSink;
0129:        import org.netbeans.modules.uml.ui.swing.drawingarea.IDrawingAreaAddNodeEventsSink;
0130:        import org.netbeans.modules.uml.ui.swing.drawingarea.IDrawingAreaContextMenuEventsSink;
0131:        import org.netbeans.modules.uml.ui.swing.drawingarea.IDrawingAreaEventsSink;
0132:        import org.netbeans.modules.uml.ui.swing.drawingarea.IDrawingAreaReconnectEdgeEventsSink;
0133:        import org.netbeans.modules.uml.ui.swing.drawingarea.IDrawingAreaSelectionEventsSink;
0134:        import org.netbeans.modules.uml.ui.swing.drawingarea.IDrawingAreaSynchEventsSink;
0135:
0136:        /**
0137:         * DispatcherHelper is used to register and revoke to various event dispatchers.
0138:         * 
0139:         * @author Trey Spiva
0140:         */
0141:        public class DispatchHelper {
0142:            private HashMap<Object, Integer> m_CookieMap = new HashMap<Object, Integer>();
0143:            //private HashMap  m_CookieMap = new HashMap();
0144:            private IWorkspaceEventDispatcher m_WorkspaceEventDispatcher = null;
0145:            private IStructureEventDispatcher m_StructureEventDispatcher = null;
0146:            private IEventDispatchController m_EventController = null;
0147:            private IElementChangeEventDispatcher m_ElementChangeDispatcher = null;
0148:            private IClassifierEventDispatcher m_ClassifierEventDispatcher = null;
0149:            private IDynamicsEventDispatcher m_DynamicsEventDispatcher = null;
0150:            private IElementLifeTimeEventDispatcher m_LifeTimeEventDispatcher = null;
0151:            private IRelationValidatorEventDispatcher m_RelationValidatorEventDispatcher = null;
0152:            private static IProjectTreeEventDispatcher m_ProjectTreeEventDispatcher = null;
0153:            private static IDrawingAreaEventDispatcher m_DrawingAreaDispatcher = null;
0154:            private static IPreferenceManagerEventDispatcher m_PreferenceEventDispatcher = null;
0155:            private static IProjectTreeFilterDialogEventDispatcher m_ProjectTreeFilterEventDispatcher = null;
0156:            private IWorkspaceEventDispatcher m_WorkspaceEventDispatcherDP = null;
0157:            private IActivityEventDispatcher m_ActivityEventDispatcher = null;
0158:
0159:            //**************************************************
0160:            // Workspace Event Sinks
0161:            //**************************************************
0162:
0163:            public void registerForWorkspaceEvents(IWorkspaceEventsSink sink) {
0164:                if (sink != null) {
0165:                    IWorkspaceEventDispatcher dispatcher = getWorkspaceDispatcher();
0166:                    if (dispatcher != null) {
0167:                        dispatcher.registerForWorkspaceEvents(sink);
0168:                        //m_CookieMap.put(sink, new Integer(cookie));
0169:                    }
0170:
0171:                }
0172:            }
0173:
0174:            public void revokeWorkspaceSink(IWorkspaceEventsSink sink)
0175:                    throws InvalidArguments {
0176:                if (sink != null) {
0177:                    //Integer cookie = (Integer)m_CookieMap.get(sink);
0178:                    //int value = cookie.intValue();
0179:
0180:                    IWorkspaceEventDispatcher dispatcher = getWorkspaceDispatcher();
0181:                    dispatcher.revokeWorkspaceSink(sink);
0182:                } else {
0183:                    throw new InvalidArguments();
0184:                }
0185:            }
0186:
0187:            public void registerForWSProjectEvents(IWSProjectEventsSink sink) {
0188:                if (sink != null) {
0189:                    IWorkspaceEventDispatcher dispatcher = getWorkspaceDispatcher();
0190:                    if (dispatcher != null) {
0191:                        dispatcher.registerForWSProjectEvents(sink);
0192:                        //m_CookieMap.put(sink, new Integer(cookie));
0193:                    }
0194:
0195:                } else {
0196:                    // TODO: I need to notify the caller that the register failed.          
0197:                }
0198:            }
0199:
0200:            public void revokeWSProjectSink(IWSProjectEventsSink sink)
0201:                    throws InvalidArguments {
0202:                if (sink != null) {
0203:                    //Integer cookie = (Integer)m_CookieMap.get(sink);
0204:                    //int value = cookie.intValue();
0205:
0206:                    IWorkspaceEventDispatcher dispatcher = getWorkspaceDispatcher();
0207:                    dispatcher.revokeWSProjectSink(sink);
0208:                } else {
0209:                    throw new InvalidArguments();
0210:                }
0211:            }
0212:
0213:            public void registerForWSElementEvents(IWSElementEventsSink pSink) {
0214:            }
0215:
0216:            public void revokeWSElementSink(IWSElementEventsSink pSink) {
0217:            }
0218:
0219:            public void registerForWSElementModifiedEvents(
0220:                    IWSElementModifiedEventsSink pSink) {
0221:            }
0222:
0223:            public void revokeWSElementModifiedSink(
0224:                    IWSElementModifiedEventsSink pSink) {
0225:            }
0226:
0227:            //		public void registerForWorkspaceEventsDP(IEventsSink pSink){}
0228:            //		public void revokeWorkspaceSinkDP(IEventsSink pSink){}
0229:            //		public void registerForWSProjectEventsDP(IEventsSink pSink){}
0230:            //		public void revokeWSProjectSinkDP(IEventsSink pSink){}
0231:
0232:            //	**************************************************
0233:            // Perference Manager Events
0234:            //**************************************************
0235:
0236:            public void registerForPreferenceManagerEvents(
0237:                    IPreferenceManagerEventsSink sink) {
0238:                if (sink != null) {
0239:                    IPreferenceManagerEventDispatcher dispatcher = getPreferenceManagerDispatcher();
0240:                    if (dispatcher != null) {
0241:                        dispatcher.registerPreferenceManagerEvents(sink);
0242:                        //int cookie = dispatcher.registerPreferenceManagerEvents(sink);
0243:                        //m_CookieMap.put(sink, new Integer(cookie));
0244:                    }
0245:
0246:                } else {
0247:                    // TODO: I need to notify the caller that the register failed.          
0248:                }
0249:            }
0250:
0251:            public void revokePreferenceManagerSink(
0252:                    IPreferenceManagerEventsSink sink) throws InvalidArguments {
0253:                if (sink != null) {
0254:                    //Integer cookie = (Integer)m_CookieMap.get(sink);
0255:                    //int value = cookie.intValue();
0256:
0257:                    IPreferenceManagerEventDispatcher dispatcher = getPreferenceManagerDispatcher();
0258:                    dispatcher.revokePreferenceManagerSink(sink);
0259:                } else {
0260:                    throw new InvalidArguments();
0261:                }
0262:            }
0263:
0264:            //**************************************************
0265:            // Core product dispatcher
0266:            //**************************************************
0267:
0268:            public void registerForInitEvents(ICoreProductInitEventsSink sink) {
0269:                if (sink != null) {
0270:                    ICoreProductEventDispatcher dispatcher = getCoreProductDispatcher();
0271:                    if (dispatcher != null) {
0272:                        dispatcher.registerForInitEvents(sink);
0273:                        //m_CookieMap.put(sink, new Integer(cookie));
0274:                    }
0275:
0276:                } else {
0277:                    // TODO: I need to notify the caller that the register failed.          
0278:                }
0279:            }
0280:
0281:            public void revokeInitSink(ICoreProductInitEventsSink sink)
0282:                    throws InvalidArguments {
0283:                if (sink != null) {
0284:                    //Integer cookie = (Integer)m_CookieMap.get(sink);
0285:                    //int value = cookie.intValue();
0286:
0287:                    ICoreProductEventDispatcher dispatcher = getCoreProductDispatcher();
0288:                    dispatcher.revokeInitSink(sink);
0289:                } else {
0290:                    throw new InvalidArguments();
0291:                }
0292:            }
0293:
0294:            //**************************************************
0295:            // Structure Event Dispatcher
0296:            //**************************************************
0297:
0298:            public void registerForArtifactEvents(IArtifactEventsSink pSink) {
0299:            }
0300:
0301:            public void revokeArtifactSink(IArtifactEventsSink pSink) {
0302:            }
0303:
0304:            public void registerForProjectEvents(IProjectEventsSink sink) {
0305:                if (sink != null) {
0306:                    IStructureEventDispatcher dispatcher = getStructureDispatcher();
0307:                    if (dispatcher != null) {
0308:                        //				TODO: We do not have a JCWrapper from the ProjectEventsSink.
0309:                        dispatcher.registerForProjectEvents(sink);
0310:                        //m_CookieMap.put(sink, new Integer(cookie));
0311:                    }
0312:
0313:                } else {
0314:                    // TODO: I need to notify the caller that the register failed.          
0315:                }
0316:            }
0317:
0318:            public void revokeProjectSink(IProjectEventsSink sink)
0319:                    throws InvalidArguments {
0320:                if (sink != null) {
0321:                    //Integer cookie = (Integer)m_CookieMap.get(sink);
0322:                    //int value = cookie.intValue();
0323:
0324:                    IStructureEventDispatcher dispatcher = getStructureDispatcher();
0325:                    dispatcher.revokeProjectSink(sink);
0326:                } else {
0327:                    throw new InvalidArguments();
0328:                }
0329:            }
0330:
0331:            //**************************************************
0332:            // Activities Event Dispatcher
0333:            //**************************************************	
0334:            public void registerForActivityEdgeEvents(
0335:                    IActivityEdgeEventsSink pSink) {
0336:
0337:                if (pSink != null) {
0338:                    IActivityEventDispatcher dispatcher = getActivitiesDispatcher();
0339:                    if (dispatcher != null) {
0340:                        // TODO: We do not have a JCWrapper from the ProjectEventsSink.
0341:                        dispatcher.registerForActivityEdgeEvents(pSink);
0342:                        //m_CookieMap.put(pSink, new Integer(cookie));
0343:                    }
0344:
0345:                } else {
0346:                    // TODO: I need to notify the caller that the register failed.          
0347:                }
0348:
0349:            }
0350:
0351:            public void revokeActivityEdgeSink(IActivityEdgeEventsSink pSink) {
0352:
0353:                if (pSink != null) {
0354:                    //Integer cookie = (Integer)m_CookieMap.get(pSink);
0355:                    //int value = cookie.intValue();
0356:
0357:                    IActivityEventDispatcher dispatcher = getActivitiesDispatcher();
0358:                    dispatcher.revokeActivityEdgeSink(pSink);
0359:                }
0360:
0361:            }
0362:
0363:            //**************************************************
0364:            // Drawing Area Event Dispatcher
0365:            //************************************************** 
0366:            public void registerDrawingAreaEvents(IDrawingAreaEventsSink sink) {
0367:                if (sink != null) {
0368:                    IDrawingAreaEventDispatcher dispatcher = getDrawingAreaDispatcher();
0369:                    if (dispatcher != null) {
0370:                        // TODO: We do not have a JCWrapper from the ProjectEventsSink.
0371:                        int cookie = dispatcher.registerDrawingAreaEvents(sink);
0372:                        //m_CookieMap.put(sink, new Integer(cookie));
0373:                    }
0374:
0375:                } else {
0376:                    // TODO: I need to notify the caller that the register failed.          
0377:                }
0378:            }
0379:
0380:            public void revokeDrawingAreaSink(IDrawingAreaEventsSink sink) {
0381:                if (sink != null) {
0382:                    //Integer cookie = (Integer)m_CookieMap.get(sink);
0383:                    //int value = cookie.intValue();
0384:
0385:                    IDrawingAreaEventDispatcher dispatcher = getDrawingAreaDispatcher();
0386:                    dispatcher.revokeDrawingAreaSink(sink);
0387:                }
0388:            }
0389:
0390:            public void registerDrawingAreaSynchEvents(
0391:                    IDrawingAreaSynchEventsSink sink) {
0392:                if (sink != null) {
0393:                    IDrawingAreaEventDispatcher dispatcher = getDrawingAreaDispatcher();
0394:                    if (dispatcher != null) {
0395:                        // TODO: We do not have a JCWrapper from the ProjectEventsSink.
0396:                        dispatcher.registerDrawingAreaSynchEvents(sink);
0397:                        //m_CookieMap.put(sink, new Integer(cookie));
0398:                    }
0399:
0400:                } else {
0401:                    // TODO: I need to notify the caller that the register failed.          
0402:                }
0403:            }
0404:
0405:            public void revokeDrawingAreaSynchSink(
0406:                    IDrawingAreaSynchEventsSink sink) {
0407:                if (sink != null) {
0408:                    //Integer cookie = (Integer)m_CookieMap.get(sink);
0409:                    //int value = cookie.intValue();
0410:
0411:                    IDrawingAreaEventDispatcher dispatcher = getDrawingAreaDispatcher();
0412:                    dispatcher.revokeDrawingAreaSynchSink(sink);
0413:                }
0414:            }
0415:
0416:            public void registerDrawingAreaContextMenuEvents(
0417:                    IDrawingAreaContextMenuEventsSink sink) {
0418:                if (sink != null) {
0419:                    IDrawingAreaEventDispatcher dispatcher = getDrawingAreaDispatcher();
0420:                    if (dispatcher != null) {
0421:                        // TODO: We do not have a JCWrapper from the ProjectEventsSink.
0422:                        dispatcher.registerDrawingAreaContextMenuEvents(sink);
0423:                        //m_CookieMap.put(sink, new Integer(cookie));
0424:                    }
0425:
0426:                } else {
0427:                    // TODO: I need to notify the caller that the register failed.          
0428:                }
0429:            }
0430:
0431:            public void revokeDrawingAreaContextMenuSink(
0432:                    IDrawingAreaContextMenuEventsSink sink) {
0433:                if (sink != null) {
0434:                    //Integer cookie = (Integer)m_CookieMap.get(sink);
0435:                    //int value = cookie.intValue();
0436:
0437:                    IDrawingAreaEventDispatcher dispatcher = getDrawingAreaDispatcher();
0438:                    dispatcher.revokeDrawingAreaContextMenuSink(sink);
0439:                }
0440:            }
0441:
0442:            public void registerDrawingAreaSelectionEvents(
0443:                    IDrawingAreaSelectionEventsSink sink) {
0444:                if (sink != null) {
0445:                    IDrawingAreaEventDispatcher dispatcher = getDrawingAreaDispatcher();
0446:                    if (dispatcher != null) {
0447:                        // TODO: We do not have a JCWrapper from the ProjectEventsSink.
0448:                        dispatcher.registerDrawingAreaSelectionEvents(sink);
0449:                        //m_CookieMap.put(sink, new Integer(cookie));
0450:                    }
0451:
0452:                } else {
0453:                    // TODO: I need to notify the caller that the register failed.          
0454:                }
0455:            }
0456:
0457:            public void revokeDrawingAreaSelectionSink(
0458:                    IDrawingAreaSelectionEventsSink sink) {
0459:                if (sink != null) {
0460:                    //Integer cookie = (Integer)m_CookieMap.get(sink);
0461:                    //int value = cookie.intValue();
0462:
0463:                    IDrawingAreaEventDispatcher dispatcher = getDrawingAreaDispatcher();
0464:                    dispatcher.revokeDrawingAreaSelectionSink(sink);
0465:                }
0466:            }
0467:
0468:            public void registerDrawingAreaAddNodeEvents(
0469:                    IDrawingAreaAddNodeEventsSink sink) {
0470:                if (sink != null) {
0471:                    IDrawingAreaEventDispatcher dispatcher = getDrawingAreaDispatcher();
0472:                    if (dispatcher != null) {
0473:                        // TODO: We do not have a JCWrapper from the ProjectEventsSink.
0474:                        int cookie = dispatcher
0475:                                .registerDrawingAreaAddNodeEvents(sink);
0476:                        //m_CookieMap.put(sink, new Integer(cookie));
0477:                    }
0478:
0479:                } else {
0480:                    // TODO: I need to notify the caller that the register failed.          
0481:                }
0482:            }
0483:
0484:            public void revokeDrawingAreaAddNodeSink(
0485:                    IDrawingAreaAddNodeEventsSink sink) {
0486:                if (sink != null) {
0487:                    //Integer cookie = (Integer)m_CookieMap.get(sink);
0488:                    //int value = cookie.intValue();
0489:
0490:                    IDrawingAreaEventDispatcher dispatcher = getDrawingAreaDispatcher();
0491:                    dispatcher.revokeDrawingAreaAddNodeSink(sink);
0492:                }
0493:            }
0494:
0495:            public void registerDrawingAreaAddEdgeEvents(
0496:                    IDrawingAreaAddEdgeEventsSink sink) {
0497:                if (sink != null) {
0498:                    IDrawingAreaEventDispatcher dispatcher = getDrawingAreaDispatcher();
0499:                    if (dispatcher != null) {
0500:                        // TODO: We do not have a JCWrapper from the ProjectEventsSink.
0501:                        int cookie = dispatcher
0502:                                .registerDrawingAreaAddEdgeEvents(sink);
0503:                        //m_CookieMap.put(sink, new Integer(cookie));
0504:                    }
0505:
0506:                } else {
0507:                    // TODO: I need to notify the caller that the register failed.          
0508:                }
0509:            }
0510:
0511:            public void revokeDrawingAreaAddEdgeSink(
0512:                    IDrawingAreaAddEdgeEventsSink sink) {
0513:                if (sink != null) {
0514:                    //Integer cookie = (Integer)m_CookieMap.get(sink);
0515:                    //int value = cookie.intValue();
0516:
0517:                    IDrawingAreaEventDispatcher dispatcher = getDrawingAreaDispatcher();
0518:                    dispatcher.revokeDrawingAreaAddEdgeSink(sink);
0519:                }
0520:            }
0521:
0522:            public void registerDrawingAreaReconnectEdgeEvents(
0523:                    IDrawingAreaReconnectEdgeEventsSink sink) {
0524:                if (sink != null) {
0525:                    IDrawingAreaEventDispatcher dispatcher = getDrawingAreaDispatcher();
0526:                    if (dispatcher != null) {
0527:                        // TODO: We do not have a JCWrapper from the ProjectEventsSink.
0528:                        int cookie = dispatcher
0529:                                .registerDrawingAreaReconnectEdgeEvents(sink);
0530:                        //m_CookieMap.put(sink, new Integer(cookie));
0531:                    }
0532:
0533:                } else {
0534:                    // TODO: I need to notify the caller that the register failed.          
0535:                }
0536:            }
0537:
0538:            public void revokeDrawingAreaReconnectEdgeSink(
0539:                    IDrawingAreaReconnectEdgeEventsSink sink) {
0540:                if (sink != null) {
0541:                    //Integer cookie = (Integer)m_CookieMap.get(sink);
0542:                    //int value = cookie.intValue();
0543:
0544:                    IDrawingAreaEventDispatcher dispatcher = getDrawingAreaDispatcher();
0545:                    dispatcher.revokeDrawingAreaReconnectEdgeSink(sink);
0546:                }
0547:            }
0548:
0549:            public void registerDrawingAreaCompartmentEvents(
0550:                    ICompartmentEventsSink sink) {
0551:                if (sink != null) {
0552:                    IDrawingAreaEventDispatcher dispatcher = getDrawingAreaDispatcher();
0553:                    if (dispatcher != null) {
0554:                        // TODO: We do not have a JCWrapper from the ProjectEventsSink.
0555:                        int cookie = dispatcher
0556:                                .registerDrawingAreaCompartmentEvents(sink);
0557:                        // m_CookieMap.put(sink, new Integer(cookie));
0558:                    }
0559:
0560:                } else {
0561:                    // TODO: I need to notify the caller that the register failed.          
0562:                }
0563:            }
0564:
0565:            public void revokeDrawingAreaCompartmentSink(
0566:                    ICompartmentEventsSink sink) {
0567:                if (sink != null) {
0568:                    //Integer cookie = (Integer)m_CookieMap.get(sink);
0569:                    //int value = cookie.intValue();
0570:
0571:                    IDrawingAreaEventDispatcher dispatcher = getDrawingAreaDispatcher();
0572:                    dispatcher.revokeDrawingAreaCompartmentSink(sink);
0573:                }
0574:            }
0575:
0576:            public void registerChangeNotificationTranslatorEvents(
0577:                    IChangeNotificationTranslatorSink sink) {
0578:                if (sink != null) {
0579:                    IDrawingAreaEventDispatcher dispatcher = getDrawingAreaDispatcher();
0580:                    if (dispatcher != null) {
0581:                        // TODO: We do not have a JCWrapper from the ProjectEventsSink.
0582:                        int cookie = dispatcher
0583:                                .registerChangeNotificationTranslatorEvents(sink);
0584:                        //m_CookieMap.put(sink, new Integer(cookie));
0585:                    }
0586:
0587:                } else {
0588:                    // TODO: I need to notify the caller that the register failed.          
0589:                }
0590:            }
0591:
0592:            public void revokeChangeNotificationTranslatorSink(
0593:                    IChangeNotificationTranslatorSink sink) {
0594:                if (sink != null) {
0595:                    //Integer cookie = (Integer)m_CookieMap.get(sink);
0596:                    //int value = cookie.intValue();
0597:
0598:                    IDrawingAreaEventDispatcher dispatcher = getDrawingAreaDispatcher();
0599:                    dispatcher.revokeChangeNotificationTranslatorSink(sink);
0600:                }
0601:            }
0602:
0603:            //**************************************************
0604:            // Messenger Dispatcher
0605:            //**************************************************
0606:            public void registerMessengerEvents(IMessengerEventsSink pSink) {
0607:            }
0608:
0609:            public void revokeMessengerSink(IMessengerEventsSink pSink) {
0610:            }
0611:
0612:            //**************************************************
0613:            // VBA Dispatcher
0614:            //**************************************************
0615:            //public void registerVBAProjectEvents(IVBAProjectEventsSink pSink){}
0616:            //public void revokeVBAProjectSink(IVBAProjectEventsSink pSink){}
0617:
0618:            //**************************************************
0619:            // Project Tree event dispatcher
0620:            //**************************************************
0621:            public void registerProjectTreeEvents(IProjectTreeEventsSink sink) {
0622:                if (sink != null) {
0623:                    IProjectTreeEventDispatcher dispatcher = getProjectTreeDispatcher();
0624:                    if (dispatcher != null) {
0625:                        //				int cookie = dispatcher.registerProjectTreeEvents(sink);
0626:                        //				m_CookieMap.put(sink, new Integer(cookie));
0627:
0628:                        dispatcher.registerProjectTreeEvents(sink);
0629:                    }
0630:
0631:                } else {
0632:                    // TODO: I need to notify the caller that the register failed.          
0633:                }
0634:            }
0635:
0636:            public void revokeProjectTreeSink(IProjectTreeEventsSink sink) {
0637:
0638:                //		Integer cookie = (Integer)m_CookieMap.get(sink);
0639:                //		int value = cookie.intValue();
0640:                //
0641:                IProjectTreeEventDispatcher dispatcher = getProjectTreeDispatcher();
0642:                dispatcher.revokeProjectTreeSink(sink);
0643:            }
0644:
0645:            public void registerProjectTreeContextMenuEvents(
0646:                    IProjectTreeContextMenuEventsSink pSink) {
0647:                if (pSink != null) {
0648:                    IProjectTreeEventDispatcher dispatcher = getProjectTreeDispatcher();
0649:                    if (dispatcher != null) {
0650:                        //						int cookie = dispatcher.registerProjectTreeEvents(sink);
0651:                        //						m_CookieMap.put(sink, new Integer(cookie));
0652:
0653:                        dispatcher.registerProjectTreeContextMenuEvents(pSink);
0654:                    }
0655:
0656:                } else {
0657:                    // TODO: I need to notify the caller that the register failed.          
0658:                }
0659:            }
0660:
0661:            public void revokeProjectTreeContextMenuSink(
0662:                    IProjectTreeContextMenuEventsSink pSink) {
0663:                IProjectTreeEventDispatcher dispatcher = getProjectTreeDispatcher();
0664:                dispatcher.revokeProjectTreeContextMenuSink(pSink);
0665:            }
0666:
0667:            //**************************************************
0668:            // Add In Dispatcher
0669:            //**************************************************
0670:            //	public void registerAddInEvents(IAddInEventsSink pSink){}
0671:            //	public void revokeAddInSink(IAddInEventsSink pSink){}
0672:
0673:            //**************************************************
0674:            // Element Change Event Dispatcher
0675:            //**************************************************
0676:            public void registerForElementModifiedEvents(
0677:                    IElementModifiedEventsSink sink) {
0678:                if (sink != null) {
0679:                    IElementChangeEventDispatcher dispatcher = getElementChangeDispatcher();
0680:                    if (dispatcher != null) {
0681:                        // TODO: We do not have a JCWrapper from the ProjectEventsSink.
0682:                        dispatcher.registerForElementModifiedEvents(sink);
0683:                        //m_CookieMap.put(sink, new Integer(cookie));
0684:                    }
0685:
0686:                } else {
0687:                    // TODO: I need to notify the caller that the register failed.          
0688:                }
0689:            }
0690:
0691:            public void revokeElementModifiedSink(
0692:                    IElementModifiedEventsSink sink) {
0693:                if (sink != null) {
0694:                    //Integer cookie = (Integer)m_CookieMap.get(sink);
0695:                    //int value = cookie.intValue();
0696:
0697:                    IElementChangeEventDispatcher dispatcher = getElementChangeDispatcher();
0698:                    dispatcher.revokeElementModifiedSink(sink);
0699:                }
0700:            }
0701:
0702:            public void registerForMetaAttributeModifiedEvents(
0703:                    IMetaAttributeModifiedEventsSink sink) {
0704:                if (sink != null) {
0705:                    IElementChangeEventDispatcher dispatcher = getElementChangeDispatcher();
0706:                    if (dispatcher != null) {
0707:                        // TODO: We do not have a JCWrapper from the ProjectEventsSink.
0708:                        dispatcher.registerForMetaAttributeModifiedEvents(sink);
0709:                        //m_CookieMap.put(sink, new Integer(cookie));
0710:                    }
0711:
0712:                } else {
0713:                    // TODO: I need to notify the caller that the register failed.          
0714:                }
0715:            }
0716:
0717:            public void revokeMetaAttributeModifiedSink(
0718:                    IMetaAttributeModifiedEventsSink sink) {
0719:                if (sink != null) {
0720:                    //Integer cookie = (Integer)m_CookieMap.get(sink);
0721:                    //int value = cookie.intValue();
0722:
0723:                    IElementChangeEventDispatcher dispatcher = getElementChangeDispatcher();
0724:                    dispatcher.revokeMetaAttributeModifiedSink(sink);
0725:                }
0726:            }
0727:
0728:            public void registerForDocumentationModifiedEvents(
0729:                    IDocumentationModifiedEventsSink sink) {
0730:                if (sink != null) {
0731:                    IElementChangeEventDispatcher dispatcher = getElementChangeDispatcher();
0732:                    if (dispatcher != null) {
0733:                        // TODO: We do not have a JCWrapper from the ProjectEventsSink.
0734:                        dispatcher.registerForDocumentationModifiedEvents(sink);
0735:                        //m_CookieMap.put(sink, new Integer(cookie));
0736:                    }
0737:
0738:                } else {
0739:                    // TODO: I need to notify the caller that the register failed.          
0740:                }
0741:            }
0742:
0743:            public void revokeDocumentationModifiedSink(
0744:                    IDocumentationModifiedEventsSink sink) {
0745:                if (sink != null) {
0746:                    //Integer cookie = (Integer)m_CookieMap.get(sink);
0747:                    //int value = cookie.intValue();
0748:
0749:                    IElementChangeEventDispatcher dispatcher = getElementChangeDispatcher();
0750:                    dispatcher.revokeDocumentationModifiedSink(sink);
0751:                }
0752:            }
0753:
0754:            public void registerForNamespaceModifiedEvents(
0755:                    INamespaceModifiedEventsSink sink) {
0756:                if (sink != null) {
0757:                    IElementChangeEventDispatcher dispatcher = getElementChangeDispatcher();
0758:                    if (dispatcher != null) {
0759:                        // TODO: We do not have a JCWrapper from the ProjectEventsSink.
0760:                        dispatcher.registerForNamespaceModifiedEvents(sink);
0761:                        //m_CookieMap.put(sink, new Integer(cookie));
0762:                    }
0763:                } else {
0764:                    // TODO: I need to notify the caller that the register failed.
0765:                }
0766:            }
0767:
0768:            public void revokeNamespaceModifiedSink(
0769:                    INamespaceModifiedEventsSink sink) {
0770:                if (sink != null) {
0771:                    //Integer cookie = (Integer)m_CookieMap.get(sink);
0772:                    //int value = cookie.intValue();
0773:
0774:                    IElementChangeEventDispatcher dispatcher = getElementChangeDispatcher();
0775:                    dispatcher.revokeNamespaceModifiedSink(sink);
0776:                }
0777:            }
0778:
0779:            public void registerForNamedElementEvents(
0780:                    INamedElementEventsSink sink) {
0781:                if (sink != null) {
0782:                    IElementChangeEventDispatcher dispatcher = getElementChangeDispatcher();
0783:                    if (dispatcher != null) {
0784:                        // TODO: We do not have a JCWrapper from the ProjectEventsSink.
0785:                        dispatcher.registerForNamedElementEvents(sink);
0786:                        //m_CookieMap.put(sink, new Integer(cookie));
0787:                    }
0788:
0789:                } else {
0790:                    // TODO: I need to notify the caller that the register failed.          
0791:                }
0792:            }
0793:
0794:            public void revokeNamedElementSink(INamedElementEventsSink sink) {
0795:                if (sink != null) {
0796:                    //Integer cookie = (Integer)m_CookieMap.get(sink);
0797:                    //int value = cookie.intValue();
0798:
0799:                    IElementChangeEventDispatcher dispatcher = getElementChangeDispatcher();
0800:                    dispatcher.revokeNamedElementSink(sink);
0801:                }
0802:            }
0803:
0804:            public void registerForExternalElementEventsSink(
0805:                    IExternalElementEventsSink sink) {
0806:                if (sink != null) {
0807:                    IElementChangeEventDispatcher dispatcher = getElementChangeDispatcher();
0808:                    if (dispatcher != null) {
0809:                        // TODO: We do not have a JCWrapper from the ProjectEventsSink.
0810:                        dispatcher.registerForExternalElementEventsSink(sink);
0811:                        //m_CookieMap.put(sink, new Integer(cookie));
0812:                    }
0813:
0814:                } else {
0815:                    // TODO: I need to notify the caller that the register failed.          
0816:                }
0817:            }
0818:
0819:            public void revokeExternalElementEventsSink(
0820:                    IExternalElementEventsSink sink) {
0821:                if (sink != null) {
0822:                    //Integer cookie = (Integer)m_CookieMap.get(sink);
0823:                    //int value = cookie.intValue();
0824:
0825:                    IElementChangeEventDispatcher dispatcher = getElementChangeDispatcher();
0826:                    dispatcher.revokeExternalElementEventsSink(sink);
0827:                }
0828:            }
0829:
0830:            public void registerForStereotypeEventsSink(
0831:                    IStereotypeEventsSink sink) {
0832:                if (sink != null) {
0833:                    IElementChangeEventDispatcher dispatcher = getElementChangeDispatcher();
0834:                    if (dispatcher != null) {
0835:                        // TODO: We do not have a JCWrapper from the ProjectEventsSink.
0836:                        dispatcher.registerForStereotypeEventsSink(sink);
0837:                        //m_CookieMap.put(sink, new Integer(cookie));
0838:                    }
0839:
0840:                } else {
0841:                    // TODO: I need to notify the caller that the register failed.          
0842:                }
0843:            }
0844:
0845:            public void revokeStereotypeEventsSink(IStereotypeEventsSink sink) {
0846:                if (sink != null) {
0847:                    //Integer cookie = (Integer)m_CookieMap.get(sink);
0848:                    //int value = cookie.intValue();
0849:
0850:                    IElementChangeEventDispatcher dispatcher = getElementChangeDispatcher();
0851:                    dispatcher.revokeStereotypeEventsSink(sink);
0852:                }
0853:            }
0854:
0855:            public void registerForRedefinableElementModifiedEvents(
0856:                    IRedefinableElementModifiedEventsSink sink) {
0857:                if (sink != null) {
0858:                    IElementChangeEventDispatcher dispatcher = getElementChangeDispatcher();
0859:                    if (dispatcher != null) {
0860:                        // TODO: We do not have a JCWrapper from the ProjectEventsSink.
0861:                        dispatcher
0862:                                .registerForRedefinableElementModifiedEvents(sink);
0863:                        //m_CookieMap.put(sink, new Integer(cookie));
0864:                    }
0865:
0866:                } else {
0867:                    // TODO: I need to notify the caller that the register failed.          
0868:                }
0869:            }
0870:
0871:            public void revokeRedefinableElementModifiedEvents(
0872:                    IRedefinableElementModifiedEventsSink sink) {
0873:                if (sink != null) {
0874:                    //Integer cookie = (Integer)m_CookieMap.get(sink);
0875:                    //int value = cookie.intValue();
0876:
0877:                    IElementChangeEventDispatcher dispatcher = getElementChangeDispatcher();
0878:                    dispatcher.revokeRedefinableElementModifiedEvents(sink);
0879:                }
0880:            }
0881:
0882:            public void registerForPackageEvents(IPackageEventsSink sink) {
0883:                if (sink != null) {
0884:                    IElementChangeEventDispatcher dispatcher = getElementChangeDispatcher();
0885:                    if (dispatcher != null) {
0886:                        // TODO: We do not have a JCWrapper from the ProjectEventsSink.
0887:                        dispatcher.registerForPackageEventsSink(sink);
0888:                        //m_CookieMap.put(sink, new Integer(cookie));
0889:                    }
0890:
0891:                } else {
0892:                    // TODO: I need to notify the caller that the register failed.          
0893:                }
0894:            }
0895:
0896:            public void revokePackageEvents(IPackageEventsSink sink) {
0897:                if (sink != null) {
0898:                    //Integer cookie = (Integer)m_CookieMap.get(sink);
0899:                    //int value = cookie.intValue();
0900:
0901:                    IElementChangeEventDispatcher dispatcher = getElementChangeDispatcher();
0902:                    dispatcher.revokePackageEventsSink(sink);
0903:                }
0904:            }
0905:
0906:            //**************************************************
0907:            // Edit control dispatcher
0908:            //**************************************************
0909:            //public void registerEditCtrlEvents(IEditCtrlEventsSink pSink){}
0910:            //public void revokeEditCtrlSink(IEditCtrlEventsSink pSink){}
0911:
0912:            //**************************************************
0913:            // Project Tree Filter Dialog Event Dispatcher
0914:            //**************************************************
0915:            public void registerProjectTreeFilterDialogEvents(
0916:                    IProjectTreeFilterDialogEventsSink pSink) {
0917:                if (pSink != null) {
0918:                    IProjectTreeFilterDialogEventDispatcher dispatcher = null;
0919:                    dispatcher = getProjectTreeFilterDialogDispatcher();
0920:
0921:                    if (dispatcher != null) {
0922:                        dispatcher.registerProjectTreeFilterDialogEvents(pSink);
0923:                        //m_CookieMap.put(pSink, new Integer(cookie));
0924:                    }
0925:                } else {
0926:                    // TODO: I need to notify the caller that the register failed.          
0927:                }
0928:            }
0929:
0930:            public void revokeProjectTreeFilterDialogSink(
0931:                    IProjectTreeFilterDialogEventsSink pSink) {
0932:                //    Integer cookie = (Integer)m_CookieMap.get(sink);
0933:                //    int value = cookie.intValue();
0934:                //
0935:                IProjectTreeFilterDialogEventDispatcher dispatcher = null;
0936:                dispatcher = getProjectTreeFilterDialogDispatcher();
0937:                dispatcher.revokeProjectTreeFilterDialogEvents(pSink);
0938:            }
0939:
0940:            //**************************************************
0941:            // Relation validator dispatcher
0942:            //**************************************************
0943:            public void registerForRelationValidatorEvents(
0944:                    IRelationValidatorEventsSink pSink) {
0945:
0946:                if (pSink != null) {
0947:                    IRelationValidatorEventDispatcher dispatcher = getRelationDispatcher();
0948:                    if (dispatcher != null) {
0949:                        // TODO: We do not have a JCWrapper from the ProjectEventsSink.
0950:                        dispatcher.registerForRelationValidatorEvents(pSink);
0951:                        //m_CookieMap.put(pSink, new Integer(cookie));
0952:                    }
0953:                } else {
0954:                    // TODO: I need to notify the caller that the register failed.          
0955:                }
0956:            }
0957:
0958:            public void revokeRelationValidatorSink(
0959:                    IRelationValidatorEventsSink pSink) {
0960:                if (pSink != null) {
0961:                    //Integer cookie = (Integer)m_CookieMap.get(pSink);
0962:                    //int value = cookie.intValue();
0963:
0964:                    IRelationValidatorEventDispatcher dispatcher = getRelationDispatcher();
0965:                    dispatcher.revokeRelationValidatorSink(pSink);
0966:                }
0967:            }
0968:
0969:            public void registerForRelationEvents(IRelationEventsSink pSink) {
0970:                if (pSink != null) {
0971:                    IRelationValidatorEventDispatcher dispatcher = getRelationDispatcher();
0972:                    if (dispatcher != null) {
0973:                        dispatcher.registerForRelationEvents(pSink);
0974:                        //m_CookieMap.put(pSink, new Integer(cookie));
0975:                    }
0976:                } else {
0977:                    // TODO: I need to notify the caller that the register failed.          
0978:                }
0979:            }
0980:
0981:            public void revokeRelationSink(IRelationEventsSink pSink) {
0982:                if (pSink != null) {
0983:                    //Integer cookie = (Integer)m_CookieMap.get(pSink);
0984:                    //int value = cookie.intValue();
0985:
0986:                    IRelationValidatorEventDispatcher dispatcher = getRelationDispatcher();
0987:                    dispatcher.revokeRelationSink(pSink);
0988:                }
0989:            }
0990:
0991:            //**************************************************
0992:            // Lifetime dispatcher
0993:            //**************************************************
0994:            public void registerForLifeTimeEvents(
0995:                    IElementLifeTimeEventsSink pSink) {
0996:                if (pSink != null) {
0997:                    IElementLifeTimeEventDispatcher dispatcher = getLifeTimeDispatcher();
0998:                    if (dispatcher != null) {
0999:                        // TODO: We do not have a JCWrapper from the ProjectEventsSink.
1000:                        dispatcher.registerForLifeTimeEvents(pSink);
1001:                        //m_CookieMap.put(pSink, new Integer(cookie));
1002:                    }
1003:
1004:                } else {
1005:                    // TODO: I need to notify the caller that the register failed.          
1006:                }
1007:            }
1008:
1009:            public void revokeLifeTimeSink(IElementLifeTimeEventsSink pSink) {
1010:                if (pSink != null) {
1011:                    //Integer cookie = (Integer)m_CookieMap.get(pSink);
1012:                    //int value = cookie.intValue();
1013:
1014:                    IElementLifeTimeEventDispatcher dispatcher = getLifeTimeDispatcher();
1015:                    dispatcher.revokeLifeTimeSink(pSink);
1016:                }
1017:            }
1018:
1019:            public void registerElementDisposalEvents(
1020:                    IElementDisposalEventsSink pSink) {
1021:                if (pSink != null) {
1022:                    IElementLifeTimeEventDispatcher dispatcher = getLifeTimeDispatcher();
1023:                    if (dispatcher != null) {
1024:                        // TODO: We do not have a JCWrapper from the ProjectEventsSink.
1025:                        dispatcher.registerForDisposalEvents(pSink);
1026:                        //m_CookieMap.put(pSink, new Integer(cookie));
1027:                    }
1028:
1029:                } else {
1030:                    // TODO: I need to notify the caller that the register failed.          
1031:                }
1032:            }
1033:
1034:            public void revokeElementDisposalEventsSink(
1035:                    IElementDisposalEventsSink pSink) {
1036:                if (pSink != null) {
1037:                    //Integer cookie = (Integer)m_CookieMap.get(pSink);
1038:                    //int value = cookie.intValue();
1039:
1040:                    IElementLifeTimeEventDispatcher dispatcher = getLifeTimeDispatcher();
1041:                    dispatcher.revokeDisposalSink(pSink);
1042:                }
1043:            }
1044:
1045:            public void registerUnknownClassifierEvents(
1046:                    IUnknownClassifierEventsSink pSink) {
1047:                if (pSink != null) {
1048:                    IElementLifeTimeEventDispatcher dispatcher = getLifeTimeDispatcher();
1049:                    if (dispatcher != null) {
1050:                        // TODO: We do not have a JCWrapper from the ProjectEventsSink.
1051:                        dispatcher.registerForUnknownClassifierEvents(pSink);
1052:                        //m_CookieMap.put(pSink, new Integer(cookie));
1053:                    }
1054:
1055:                } else {
1056:                    // TODO: I need to notify the caller that the register failed.          
1057:                }
1058:            }
1059:
1060:            public void revokeUnknownClassifierEventsSink(
1061:                    IUnknownClassifierEventsSink pSink) {
1062:                if (pSink != null) {
1063:                    //Integer cookie = (Integer)m_CookieMap.get(pSink);
1064:                    //int value = cookie.intValue();
1065:
1066:                    IElementLifeTimeEventDispatcher dispatcher = getLifeTimeDispatcher();
1067:                    dispatcher.revokeUnknownClassifierSink(pSink);
1068:                }
1069:            }
1070:
1071:            //**************************************************
1072:            // Classifier event dispatcher
1073:            //**************************************************
1074:            public void registerForClassifierFeatureEvents(
1075:                    IClassifierFeatureEventsSink pSink) {
1076:                if (pSink != null) {
1077:                    IClassifierEventDispatcher dispatcher = getClassifierDispatcher();
1078:                    if (dispatcher != null) {
1079:                        // TODO: We do not have a JCWrapper from the ProjectEventsSink.
1080:                        dispatcher.registerForClassifierFeatureEvents(pSink);
1081:                        //m_CookieMap.put(pSink, new Integer(cookie));
1082:                    }
1083:
1084:                } else {
1085:                    // TODO: I need to notify the caller that the register failed.          
1086:                }
1087:            }
1088:
1089:            public void revokeClassifierFeatureSink(
1090:                    IClassifierFeatureEventsSink pSink) {
1091:                if (pSink != null) {
1092:                    //Integer cookie = (Integer)m_CookieMap.get(pSink);
1093:                    //int value = cookie.intValue();
1094:
1095:                    IClassifierEventDispatcher dispatcher = getClassifierDispatcher();
1096:                    dispatcher.revokeClassifierFeatureSink(pSink);
1097:                }
1098:            }
1099:
1100:            public void registerForDynamicsEvents(
1101:                    ILifelineModifiedEventsSink pSink) {
1102:                if (pSink != null) {
1103:                    IDynamicsEventDispatcher dispatcher = getDynamicsDispatcher();
1104:                    if (dispatcher != null) {
1105:                        // TODO: We do not have a JCWrapper from the ProjectEventsSink.
1106:                        dispatcher.registerForLifelineModifiedEvents(pSink);
1107:                    }
1108:                } else {
1109:                    // TODO: I need to notify the caller that the register failed.          
1110:                }
1111:            }
1112:
1113:            public void revokeDynamicsSink(ILifelineModifiedEventsSink pSink) {
1114:                if (pSink != null) {
1115:                    IDynamicsEventDispatcher dispatcher = getDynamicsDispatcher();
1116:                    dispatcher.revokeLifelineModifiedSink(pSink);
1117:                }
1118:            }
1119:
1120:            public void registerForTransformEvents(
1121:                    IClassifierTransformEventsSink pSink) {
1122:                if (pSink != null) {
1123:                    IClassifierEventDispatcher dispatcher = getClassifierDispatcher();
1124:                    if (dispatcher != null) {
1125:                        // TODO: We do not have a JCWrapper from the ProjectEventsSink.
1126:                        dispatcher.registerForTransformEvents(pSink);
1127:                        //m_CookieMap.put(pSink, new Integer(cookie));
1128:                    }
1129:
1130:                } else {
1131:                    // TODO: I need to notify the caller that the register failed.          
1132:                }
1133:            }
1134:
1135:            public void revokeTransformSink(IClassifierTransformEventsSink pSink) {
1136:                if (pSink != null) {
1137:                    //Integer cookie = (Integer)m_CookieMap.get(pSink);
1138:                    //int value = cookie.intValue();
1139:
1140:                    IClassifierEventDispatcher dispatcher = getClassifierDispatcher();
1141:                    dispatcher.revokeTransformSink(pSink);
1142:                }
1143:            }
1144:
1145:            public void registerForFeatureEvents(IFeatureEventsSink pSink) {
1146:                if (pSink != null) {
1147:                    IClassifierEventDispatcher dispatcher = getClassifierDispatcher();
1148:                    if (dispatcher != null) {
1149:                        // TODO: We do not have a JCWrapper from the ProjectEventsSink.
1150:                        dispatcher.registerForFeatureEvents(pSink);
1151:                        //m_CookieMap.put(pSink, new Integer(cookie));
1152:                    }
1153:
1154:                } else {
1155:                    // TODO: I need to notify the caller that the register failed.          
1156:                }
1157:            }
1158:
1159:            public void revokeFeatureSink(IFeatureEventsSink pSink) {
1160:                if (pSink != null) {
1161:                    //Integer cookie = (Integer)m_CookieMap.get(pSink);
1162:                    //int value = cookie.intValue();
1163:
1164:                    IClassifierEventDispatcher dispatcher = getClassifierDispatcher();
1165:                    dispatcher.revokeFeatureSink(pSink);
1166:                }
1167:            }
1168:
1169:            public void registerForStructuralFeatureEvents(
1170:                    IStructuralFeatureEventsSink pSink) {
1171:                if (pSink != null) {
1172:                    IClassifierEventDispatcher dispatcher = getClassifierDispatcher();
1173:                    if (dispatcher != null) {
1174:                        // TODO: We do not have a JCWrapper from the ProjectEventsSink.
1175:                        dispatcher.registerForStructuralFeatureEvents(pSink);
1176:                        //m_CookieMap.put(pSink, new Integer(cookie));
1177:                    }
1178:
1179:                } else {
1180:                    // TODO: I need to notify the caller that the register failed.          
1181:                }
1182:            }
1183:
1184:            public void revokeStructuralFeatureSink(
1185:                    IStructuralFeatureEventsSink pSink) {
1186:                if (pSink != null) {
1187:                    //Integer cookie = (Integer)m_CookieMap.get(pSink);
1188:                    //int value = cookie.intValue();
1189:
1190:                    IClassifierEventDispatcher dispatcher = getClassifierDispatcher();
1191:                    dispatcher.revokeStructuralFeatureSink(pSink);
1192:                }
1193:            }
1194:
1195:            public void registerForBehavioralFeatureEvents(
1196:                    IBehavioralFeatureEventsSink pSink) {
1197:                if (pSink != null) {
1198:                    IClassifierEventDispatcher dispatcher = getClassifierDispatcher();
1199:                    if (dispatcher != null) {
1200:                        // TODO: We do not have a JCWrapper from the ProjectEventsSink.
1201:                        dispatcher.registerForBehavioralFeatureEvents(pSink);
1202:                        //m_CookieMap.put(pSink, new Integer(cookie));
1203:                    }
1204:
1205:                } else {
1206:                    // TODO: I need to notify the caller that the register failed.          
1207:                }
1208:            }
1209:
1210:            public void revokeBehavioralFeatureSink(
1211:                    IBehavioralFeatureEventsSink pSink) {
1212:                if (pSink != null) {
1213:                    //Integer cookie = (Integer)m_CookieMap.get(pSink);
1214:                    //int value = cookie.intValue();
1215:
1216:                    IClassifierEventDispatcher dispatcher = getClassifierDispatcher();
1217:                    dispatcher.revokeBehavioralFeatureSink(pSink);
1218:                }
1219:            }
1220:
1221:            public void registerForParameterEvents(IParameterEventsSink pSink) {
1222:                if (pSink != null) {
1223:                    IClassifierEventDispatcher dispatcher = getClassifierDispatcher();
1224:                    if (dispatcher != null) {
1225:                        // TODO: We do not have a JCWrapper from the ProjectEventsSink.
1226:                        dispatcher.registerForParameterEvents(pSink);
1227:                        //m_CookieMap.put(pSink, new Integer(cookie));
1228:                    }
1229:
1230:                } else {
1231:                    // TODO: I need to notify the caller that the register failed.          
1232:                }
1233:            }
1234:
1235:            public void revokeParameterSink(IParameterEventsSink pSink) {
1236:                if (pSink != null) {
1237:                    //Integer cookie = (Integer)m_CookieMap.get(pSink);
1238:                    //int value = cookie.intValue();
1239:
1240:                    IClassifierEventDispatcher dispatcher = getClassifierDispatcher();
1241:                    dispatcher.revokeParameterSink(pSink);
1242:                }
1243:            }
1244:
1245:            public void registerForTypedElementEvents(
1246:                    ITypedElementEventsSink pSink) {
1247:                if (pSink != null) {
1248:                    IClassifierEventDispatcher dispatcher = getClassifierDispatcher();
1249:                    if (dispatcher != null) {
1250:                        // TODO: We do not have a JCWrapper from the ProjectEventsSink.
1251:                        dispatcher.registerForTypedElementEvents(pSink);
1252:                        //m_CookieMap.put(pSink, new Integer(cookie));
1253:                    }
1254:
1255:                } else {
1256:                    // TODO: I need to notify the caller that the register failed.          
1257:                }
1258:            }
1259:
1260:            public void revokeTypedElementSink(ITypedElementEventsSink pSink) {
1261:                if (pSink != null) {
1262:                    //Integer cookie = (Integer)m_CookieMap.get(pSink);
1263:                    //int value = cookie.intValue();
1264:
1265:                    IClassifierEventDispatcher dispatcher = getClassifierDispatcher();
1266:                    dispatcher.revokeTypedElementSink(pSink);
1267:                }
1268:            }
1269:
1270:            public void registerForAttributeEvents(IAttributeEventsSink pSink) {
1271:                if (pSink != null) {
1272:                    IClassifierEventDispatcher dispatcher = getClassifierDispatcher();
1273:                    if (dispatcher != null) {
1274:                        // TODO: We do not have a JCWrapper from the ProjectEventsSink.
1275:                        dispatcher.registerForAttributeEvents(pSink);
1276:                        //m_CookieMap.put(pSink, new Integer(cookie));
1277:                    }
1278:
1279:                } else {
1280:                    // TODO: I need to notify the caller that the register failed.          
1281:                }
1282:            }
1283:
1284:            public void revokeAttributeSink(IAttributeEventsSink pSink) {
1285:                if (pSink != null) {
1286:                    //Integer cookie = (Integer)m_CookieMap.get(pSink);
1287:                    //int value = cookie.intValue();
1288:
1289:                    IClassifierEventDispatcher dispatcher = getClassifierDispatcher();
1290:                    dispatcher.revokeAttributeSink(pSink);
1291:                }
1292:            }
1293:
1294:            public void registerForOperationEvents(IOperationEventsSink pSink) {
1295:                if (pSink != null) {
1296:                    IClassifierEventDispatcher dispatcher = getClassifierDispatcher();
1297:                    if (dispatcher != null) {
1298:                        // TODO: We do not have a JCWrapper from the ProjectEventsSink.
1299:                        dispatcher.registerForOperationEvents(pSink);
1300:                        //m_CookieMap.put(pSink, new Integer(cookie));
1301:                    }
1302:
1303:                } else {
1304:                    // TODO: I need to notify the caller that the register failed.          
1305:                }
1306:            }
1307:
1308:            public void revokeOperationSink(IOperationEventsSink pSink) {
1309:                if (pSink != null) {
1310:                    //Integer cookie = (Integer)m_CookieMap.get(pSink);
1311:                    //int value = cookie.intValue();
1312:
1313:                    IClassifierEventDispatcher dispatcher = getClassifierDispatcher();
1314:                    dispatcher.revokeOperationSink(pSink);
1315:                }
1316:            }
1317:
1318:            public void registerForAffectedElementEvents(
1319:                    IAffectedElementEventsSink pSink) {
1320:                if (pSink != null) {
1321:                    IClassifierEventDispatcher dispatcher = getClassifierDispatcher();
1322:                    if (dispatcher != null) {
1323:                        // TODO: We do not have a JCWrapper from the ProjectEventsSink.
1324:                        dispatcher.registerForAffectedElementEvents(pSink);
1325:                        //m_CookieMap.put(pSink, new Integer(cookie));
1326:                    }
1327:
1328:                } else {
1329:                    // TODO: I need to notify the caller that the register failed.          
1330:                }
1331:            }
1332:
1333:            public void revokeAffectedElementEvents(
1334:                    IAffectedElementEventsSink pSink) {
1335:                if (pSink != null) {
1336:                    //Integer cookie = (Integer)m_CookieMap.get(pSink);
1337:                    //int value = cookie.intValue();
1338:
1339:                    IClassifierEventDispatcher dispatcher = getClassifierDispatcher();
1340:                    dispatcher.revokeAffectedElementEvents(pSink);
1341:                }
1342:            }
1343:
1344:            public void registerForAssociationEndEvents(
1345:                    IAssociationEndEventsSink pSink) {
1346:                if (pSink != null) {
1347:                    IClassifierEventDispatcher dispatcher = getClassifierDispatcher();
1348:                    if (dispatcher != null) {
1349:                        // TODO: We do not have a JCWrapper from the ProjectEventsSink.
1350:                        dispatcher.registerForAssociationEndEvents(pSink);
1351:                        //m_CookieMap.put(pSink, new Integer(cookie));
1352:                    }
1353:
1354:                } else {
1355:                    // TODO: I need to notify the caller that the register failed.          
1356:                }
1357:            }
1358:
1359:            public void revokeAssociationEndEvents(
1360:                    IAssociationEndEventsSink pSink) {
1361:                if (pSink != null) {
1362:                    //Integer cookie = (Integer)m_CookieMap.get(pSink);
1363:                    //int value = cookie.intValue();
1364:
1365:                    IClassifierEventDispatcher dispatcher = getClassifierDispatcher();
1366:                    dispatcher.revokeAssociationEndSink(pSink);
1367:                }
1368:            }
1369:
1370:            //**************************************************
1371:            // RoundTrip dispatcher
1372:            //**************************************************
1373:            public void registerForRoundTripOperationEvents(
1374:                    IRoundTripOperationEventsSink pSink, String language) {
1375:            }
1376:
1377:            public void revokeRoundTripOperationEvents(
1378:                    IRoundTripOperationEventsSink pSink) {
1379:            }
1380:
1381:            public void registerForRoundTripAttributeEvents(
1382:                    IRoundTripAttributeEventsSink pSink, String language) {
1383:            }
1384:
1385:            public void revokeRoundTripAttributeEvents(
1386:                    IRoundTripAttributeEventsSink pSink) {
1387:            }
1388:
1389:            public void registerForRoundTripClassEvents(
1390:                    IRoundTripClassEventsSink pSink, String language) {
1391:            }
1392:
1393:            public void revokeRoundTripClassEvents(
1394:                    IRoundTripClassEventsSink pSink) {
1395:            }
1396:
1397:            public void registerForRoundTripPackageEvents(
1398:                    IRoundTripPackageEventsSink pSink, String language) {
1399:            }
1400:
1401:            public void revokeRoundTripPackageEvents(
1402:                    IRoundTripPackageEventsSink pSink) {
1403:            }
1404:
1405:            public void registerForRoundTripRelationEvents(
1406:                    IRoundTripRelationEventsSink pSink, String language) {
1407:            }
1408:
1409:            public void revokeRoundTripRelationEvents(
1410:                    IRoundTripRelationEventsSink pSink) {
1411:            }
1412:
1413:            public void registerForRoundTripRequestProcessorInitEvents(
1414:                    IRequestProcessorInitEventsSink pSink) {
1415:            }
1416:
1417:            public void revokeRoundTripRequestProcessorInitEvents(
1418:                    IRequestProcessorInitEventsSink pSink) {
1419:            }
1420:
1421:            //**************************************************
1422:            // SCM Dispatcher
1423:            //**************************************************
1424:            public void registerForSCMEvents(ISCMEventsSink pSink) {
1425:                //      if(pSink != null)
1426:                //      {
1427:                //         getSCMDispatcher();
1428:                //      }
1429:                if (pSink != null) {
1430:                    ISCMEventDispatcher dispatcher = getSCMDispatcher();
1431:                    if (dispatcher != null) {
1432:                        dispatcher.registerForSCMEvents(pSink);
1433:                    }
1434:
1435:                } else {
1436:                    // TODO: I need to notify the caller that the register failed.          
1437:                }
1438:            }
1439:
1440:            public void revokeSCMSink(ISCMEventsSink pSink) {
1441:                if (pSink != null) {
1442:                    //Integer cookie = (Integer)m_CookieMap.get(pSink);
1443:                    //int value = cookie.intValue();
1444:
1445:                    ISCMEventDispatcher dispatcher = getSCMDispatcher();
1446:                    if (dispatcher != null) {
1447:                        dispatcher.revokeSCMSink(pSink);
1448:                    }
1449:                }
1450:            }
1451:
1452:            //**************************************************
1453:            // Event Framework Dispatcher
1454:            //**************************************************
1455:            public void registerForEventFrameworkEvents(
1456:                    IEventFrameworkEventsSink pSink) {
1457:            }
1458:
1459:            public void revokeEventFrameworkSink(IEventFrameworkEventsSink pSink) {
1460:            }
1461:
1462:            //**************************************************
1463:            // Dynamics Event Dispatcher
1464:            //**************************************************
1465:            //public void registerForDynamicsEvents(IDynamicsEventsSink pSink){}
1466:            //public void revokeDynamicsSink(IDynamicsEventsSink pSink){}
1467:
1468:            //**************************************************
1469:            // Design Pattern dispatcher
1470:            //**************************************************
1471:            //public void registerForDesignPatternEvents(IDesignPatternEventsSink pSink){}
1472:            //public void revokeDesignPatternSink(IDesignPatternEventsSink pSink){}
1473:
1474:            //**************************************************
1475:            // Dispatcher Retrieval Methods
1476:            //**************************************************
1477:
1478:            /**
1479:             * 
1480:             */
1481:            public final IWorkspaceEventDispatcher getWorkspaceDispatcher() {
1482:                //return (IWorkspaceEventDispatcher)getDispatcher(EventDispatchNameKeeper.workspaceName());
1483:                IWorkspaceEventDispatcher retVal = m_WorkspaceEventDispatcher;
1484:
1485:                if (retVal == null) {
1486:                    IEventDispatcher dispatcher = getDispatcher(EventDispatchNameKeeper
1487:                            .workspaceName());
1488:                    if (dispatcher instanceof  IWorkspaceEventDispatcher) {
1489:                        retVal = (IWorkspaceEventDispatcher) dispatcher;
1490:                    }
1491:                    m_WorkspaceEventDispatcher = retVal;
1492:                }
1493:
1494:                return retVal;
1495:            }
1496:
1497:            public final IWorkspaceEventDispatcher getWorkspaceDispatcherDP() {
1498:                IWorkspaceEventDispatcher retVal = m_WorkspaceEventDispatcherDP;
1499:
1500:                if (retVal == null) {
1501:                    IEventDispatcher dispatcher = getDispatcher(EventDispatchNameKeeper
1502:                            .workspaceNameDP());
1503:                    if (dispatcher instanceof  IWorkspaceEventDispatcher) {
1504:                        retVal = (IWorkspaceEventDispatcher) dispatcher;
1505:                    }
1506:                    m_WorkspaceEventDispatcherDP = retVal;
1507:                }
1508:
1509:                return retVal;
1510:            }
1511:
1512:            /**
1513:             * @return
1514:             */
1515:            public IElementLifeTimeEventDispatcher getLifeTimeDispatcher() {
1516:                //return (IClassifierEventDispatcher)getDispatcher(EventDispatchNameKeeper.classifier());
1517:                IElementLifeTimeEventDispatcher retVal = m_LifeTimeEventDispatcher;
1518:
1519:                if (retVal == null) {
1520:                    IEventDispatcher dispatcher = getDispatcher(EventDispatchNameKeeper
1521:                            .lifeTime());
1522:                    if (dispatcher instanceof  IElementLifeTimeEventDispatcher) {
1523:                        retVal = (IElementLifeTimeEventDispatcher) dispatcher;
1524:                    }
1525:                    m_LifeTimeEventDispatcher = retVal;
1526:                }
1527:
1528:                return retVal;
1529:            }
1530:
1531:            /**
1532:             * 
1533:             */
1534:            public IActivityEventDispatcher getActivitiesDispatcher() {
1535:                IActivityEventDispatcher retVal = m_ActivityEventDispatcher;
1536:
1537:                if (retVal == null) {
1538:                    IEventDispatcher dispatcher = getDispatcher(EventDispatchNameKeeper
1539:                            .activities());
1540:                    if (dispatcher instanceof  IActivityEventDispatcher) {
1541:                        retVal = (IActivityEventDispatcher) dispatcher;
1542:                    }
1543:                    m_ActivityEventDispatcher = retVal;
1544:                }
1545:
1546:                return retVal;
1547:
1548:            }
1549:
1550:            protected ISCMEventDispatcher getSCMDispatcher() {
1551:                ISCMEventDispatcher retVal = null;
1552:
1553:                IEventDispatcher dispatcher = getDispatcher(EventDispatchNameKeeper
1554:                        .SCM());
1555:                if (dispatcher instanceof  ISCMEventDispatcher) {
1556:                    retVal = (ISCMEventDispatcher) dispatcher;
1557:                }
1558:
1559:                return retVal;
1560:            }
1561:
1562:            /**
1563:             * 
1564:             */
1565:            protected IClassifierEventDispatcher getClassifierDispatcher() {
1566:                //return (IClassifierEventDispatcher)getDispatcher(EventDispatchNameKeeper.classifier());
1567:                IClassifierEventDispatcher retVal = m_ClassifierEventDispatcher;
1568:
1569:                if (retVal == null) {
1570:                    IEventDispatcher dispatcher = getDispatcher(EventDispatchNameKeeper
1571:                            .classifier());
1572:                    if (dispatcher instanceof  IClassifierEventDispatcher) {
1573:                        retVal = (IClassifierEventDispatcher) dispatcher;
1574:                    }
1575:                    m_ClassifierEventDispatcher = retVal;
1576:                }
1577:
1578:                return retVal;
1579:
1580:            }
1581:
1582:            protected IDynamicsEventDispatcher getDynamicsDispatcher() {
1583:                IDynamicsEventDispatcher retVal = m_DynamicsEventDispatcher;
1584:
1585:                if (retVal == null) {
1586:                    IEventDispatcher dispatcher = getDispatcher(EventDispatchNameKeeper
1587:                            .dynamics());
1588:                    if (dispatcher instanceof  IDynamicsEventDispatcher) {
1589:                        retVal = (IDynamicsEventDispatcher) dispatcher;
1590:                    }
1591:                    m_DynamicsEventDispatcher = retVal;
1592:                }
1593:                return retVal;
1594:            }
1595:
1596:            /**
1597:             * @return
1598:             */
1599:            public final IPreferenceManagerEventDispatcher getPreferenceManagerDispatcher() {
1600:                IPreferenceManagerEventDispatcher retVal = null;
1601:                if (m_PreferenceEventDispatcher == null) {
1602:                    m_PreferenceEventDispatcher = (IPreferenceManagerEventDispatcher) getJavaDispatcher(EventDispatchNameKeeper
1603:                            .preferenceManager());
1604:                }
1605:                // Since we are not using the Java code 100% (Basically we are not using core at
1606:                // all.  I will have to create the Dispatcher and add it to core if it has not 
1607:                // already been added.
1608:
1609:                if (m_PreferenceEventDispatcher == null) {
1610:                    m_PreferenceEventDispatcher = new PreferenceManagerEventDispatcher();
1611:                    addJavaDispatcher(EventDispatchNameKeeper
1612:                            .preferenceManager(), m_PreferenceEventDispatcher);
1613:                }
1614:
1615:                return m_PreferenceEventDispatcher;
1616:            }
1617:
1618:            /**
1619:             * @return
1620:             */
1621:            public ICoreProductEventDispatcher getCoreProductDispatcher() {
1622:                //return (ICoreProductEventDispatcher)getDispatcher(EventDispatchNameKeeper.coreProduct());
1623:                ICoreProductEventDispatcher retVal = null;
1624:
1625:                IEventDispatcher dispatcher = getDispatcher(EventDispatchNameKeeper
1626:                        .coreProduct());
1627:                if (dispatcher instanceof  ICoreProductEventDispatcher) {
1628:                    retVal = (ICoreProductEventDispatcher) dispatcher;
1629:                }
1630:
1631:                return retVal;
1632:            }
1633:
1634:            /**
1635:             * @return
1636:             */
1637:            public IStructureEventDispatcher getStructureDispatcher() {
1638:                //return (IStructureEventDispatcher)getDispatcher(EventDispatchNameKeeper.structure());
1639:                IStructureEventDispatcher retVal = m_StructureEventDispatcher;
1640:
1641:                if (retVal == null) {
1642:                    IEventDispatcher dispatcher = getDispatcher(EventDispatchNameKeeper
1643:                            .structure());
1644:                    if (dispatcher instanceof  IStructureEventDispatcher) {
1645:                        retVal = (IStructureEventDispatcher) dispatcher;
1646:                    }
1647:                }
1648:
1649:                return retVal;
1650:            }
1651:
1652:            /**
1653:             * Gets the project tree dispatcher.
1654:             */
1655:            public IProjectTreeEventDispatcher getProjectTreeDispatcher() {
1656:                //return (IProjectTreeEventDispatcher)getJavaDispatcher(EventDispatchNameKeeper.projectTreeName());
1657:
1658:                if (m_ProjectTreeEventDispatcher == null) {
1659:                    m_ProjectTreeEventDispatcher = (IProjectTreeEventDispatcher) getJavaDispatcher(EventDispatchNameKeeper
1660:                            .projectTreeName());
1661:                }
1662:                // Since we are not using the Java code 100% (Basically we are not using core at
1663:                // all.  I will have to create the Dispatcher and add it to core if it has not 
1664:                // already been added.
1665:
1666:                if (m_ProjectTreeEventDispatcher == null) {
1667:                    m_ProjectTreeEventDispatcher = new ProjectTreeEventDispatcherImpl();
1668:                    addJavaDispatcher(
1669:                            EventDispatchNameKeeper.projectTreeName(),
1670:                            m_ProjectTreeEventDispatcher);
1671:                }
1672:
1673:                return m_ProjectTreeEventDispatcher;
1674:
1675:            }
1676:
1677:            /**
1678:             * Gets the project tree dispatcher.
1679:             */
1680:            public IProjectTreeFilterDialogEventDispatcher getProjectTreeFilterDialogDispatcher() {
1681:                //return (IProjectTreeEventDispatcher)getJavaDispatcher(EventDispatchNameKeeper.projectTreeName());
1682:
1683:                if (m_ProjectTreeFilterEventDispatcher == null) {
1684:                    m_ProjectTreeFilterEventDispatcher = (IProjectTreeFilterDialogEventDispatcher) getJavaDispatcher(EventDispatchNameKeeper
1685:                            .projectTreeFilterDialogName());
1686:                }
1687:                // Since we are not using the Java code 100% (Basically we are not using core at
1688:                // all.  I will have to create the Dispatcher and add it to core if it has not 
1689:                // already been added.
1690:
1691:                if (m_ProjectTreeFilterEventDispatcher == null) {
1692:                    m_ProjectTreeFilterEventDispatcher = new ProjectTreeFilterDialogEventDispatcher();
1693:                    addJavaDispatcher(EventDispatchNameKeeper
1694:                            .projectTreeFilterDialogName(),
1695:                            m_ProjectTreeFilterEventDispatcher);
1696:                }
1697:
1698:                return m_ProjectTreeFilterEventDispatcher;
1699:
1700:            }
1701:
1702:            /**
1703:             * Gets the drawing area dispatcher.
1704:             */
1705:            public IDrawingAreaEventDispatcher getDrawingAreaDispatcher() {
1706:                //return (IDrawingAreaEventDispatcher)getJavaDispatcher(EventDispatchNameKeeper.drawingAreaName());
1707:
1708:                if (m_DrawingAreaDispatcher == null) {
1709:                    m_DrawingAreaDispatcher = (IDrawingAreaEventDispatcher) getJavaDispatcher(EventDispatchNameKeeper
1710:                            .drawingAreaName());
1711:                }
1712:                // Since we are not using the Java code 100% (Basically we are not using core at
1713:                // all.  I will have to create the Dispatcher and add it to core if it has not 
1714:                // already been added.
1715:
1716:                if (m_DrawingAreaDispatcher == null) {
1717:                    m_DrawingAreaDispatcher = new DrawingAreaEventDispatcherImpl();
1718:                    addJavaDispatcher(
1719:                            EventDispatchNameKeeper.drawingAreaName(),
1720:                            m_DrawingAreaDispatcher);
1721:                }
1722:
1723:                return m_DrawingAreaDispatcher;
1724:
1725:            }
1726:
1727:            /**
1728:             * @return
1729:             */
1730:            public IElementChangeEventDispatcher getElementChangeDispatcher() {
1731:                //return (IElementChangeEventDispatcher)getDispatcher(EventDispatchNameKeeper.modifiedName());
1732:                IElementChangeEventDispatcher retVal = null;
1733:
1734:                IEventDispatcher dispatcher = getDispatcher(EventDispatchNameKeeper
1735:                        .modifiedName());
1736:                if (dispatcher instanceof  IElementChangeEventDispatcher) {
1737:                    retVal = (IElementChangeEventDispatcher) dispatcher;
1738:                }
1739:
1740:                return retVal;
1741:
1742:            }
1743:
1744:            protected IRelationValidatorEventDispatcher getRelationDispatcher() {
1745:                //return (IRelationValidatorEventDispatcher)getDispatcher(EventDispatchNameKeeper.relation());
1746:                IRelationValidatorEventDispatcher retVal = m_RelationValidatorEventDispatcher;
1747:
1748:                if (retVal == null) {
1749:                    IEventDispatcher dispatcher = getDispatcher(EventDispatchNameKeeper
1750:                            .relation());
1751:                    if (dispatcher instanceof  IRelationValidatorEventDispatcher) {
1752:                        retVal = (IRelationValidatorEventDispatcher) dispatcher;
1753:                    }
1754:
1755:                    m_RelationValidatorEventDispatcher = retVal;
1756:                }
1757:
1758:                return retVal;
1759:            }
1760:
1761:            /**
1762:             * This method is used to access the Java versions of Dispatch controllers.  Basically
1763:             * all UI dispatchers will be Java versions of the Event Dispatchers.  MetaModel dispatcher
1764:             * will be COM versions of the Dispatcher Controllers.
1765:             * 
1766:             * @param name
1767:             * @param newVal
1768:             */
1769:            protected void addJavaDispatcher(
1770:                    String name,
1771:                    org.netbeans.modules.uml.core.eventframework.IEventDispatcher newVal) {
1772:                try {
1773:                    ICoreProduct product = ProductRetriever.retrieveProduct();
1774:                    if (product != null) {
1775:                        IEventDispatchController controller = product
1776:                                .getEventDispatchController();
1777:                        controller.addDispatcher(name, newVal);
1778:                    }
1779:                } catch (NullPointerException e) {
1780:                    // HAVE TODO: Determine what to do about excpetions.
1781:                }
1782:            }
1783:
1784:            /**
1785:             * @param string
1786:             * @return
1787:             */
1788:            protected org.netbeans.modules.uml.core.eventframework.IEventDispatcher getJavaDispatcher(
1789:                    String name) {
1790:                IEventDispatcher retVal = null;
1791:
1792:                if (name.length() > 0) {
1793:                    try {
1794:                        ICoreProduct product = ProductRetriever
1795:                                .retrieveProduct();
1796:                        if (product != null) {
1797:                            IEventDispatchController controller = product
1798:                                    .getEventDispatchController();
1799:                            retVal = controller.retrieveDispatcher(name);
1800:                        }
1801:                    } catch (NullPointerException e) {
1802:                        // HAVE TODO: Determine what to do about excpetions.
1803:                    }
1804:                } else {
1805:                    // HAVE TODO: notify that the name is invalid.
1806:                }
1807:
1808:                return retVal;
1809:            }
1810:
1811:            /**
1812:             * @param string
1813:             */
1814:            protected final IEventDispatcher getDispatcher(String name) {
1815:                IEventDispatcher retVal = null;
1816:
1817:                if (name.length() > 0) {
1818:                    try {
1819:                        if (m_EventController == null) {
1820:                            ICoreProduct product = ProductRetriever
1821:                                    .retrieveProduct();
1822:                            m_EventController = product
1823:                                    .getEventDispatchController();
1824:                        }
1825:
1826:                        retVal = m_EventController.retrieveDispatcher(name);
1827:
1828:                        //				TODO: Add Round Trip Dispatch Event Context
1829:                        //				if(retVal == null)
1830:                        //				{
1831:                        //					IRoundTripController rtController = product.getRoundTripController();
1832:                        //					IEventDispatchController rtEventController = rtController.getEventDispatchController();
1833:                        //					
1834:                        //					retVal = rtEventController.retrieveDispatcher(name);
1835:                        //				}
1836:                    } catch (NullPointerException e) {
1837:                        // HAVE TODO: Determine what to do about excpetions.
1838:                    }
1839:                } else {
1840:                    // HAVE TODO: notify that the name is invalid.
1841:                }
1842:
1843:                return retVal;
1844:            }
1845:
1846:            /**
1847:             * Gets the edit control dispatcher
1848:             */
1849:            public IEditControlEventDispatcher getEditControlDispatcher() {
1850:                IEditControlEventDispatcher retDisp = null;
1851:                retDisp = (IEditControlEventDispatcher) getJavaDispatcher(EventDispatchNameKeeper
1852:                        .editCtrlName());
1853:                if (retDisp == null) {
1854:                    retDisp = new EditControlEventDispatcher();
1855:
1856:                    addJavaDispatcher(EventDispatchNameKeeper.editCtrlName(),
1857:                            retDisp);
1858:                }
1859:
1860:                return retDisp;
1861:            }
1862:
1863:            public void registerEditCtrlEvents(IEditControlEventSink pSink) {
1864:                if (pSink != null) {
1865:                    IEditControlEventDispatcher tempDisp = getEditControlDispatcher();
1866:                    if (tempDisp != null) {
1867:                        tempDisp.registerEditCtrlEvents(pSink);
1868:                    }
1869:                }
1870:            }
1871:
1872:            public void revokeEditCtrlSink(IEditControlEventSink pSink) {
1873:                if (pSink != null) {
1874:                    IEditControlEventDispatcher tempDisp = getEditControlDispatcher();
1875:                    if (tempDisp != null) {
1876:                        tempDisp.revokeEditCtrlSink(pSink);
1877:                    }
1878:                }
1879:            }
1880:
1881:            public void registerForWorkspaceEventsDP(IWorkspaceEventsSink sink) {
1882:                if (sink != null) {
1883:                    IWorkspaceEventDispatcher dispatcher = getWorkspaceDispatcherDP();
1884:                    if (dispatcher != null) {
1885:                        dispatcher.registerForWorkspaceEvents(sink);
1886:                    }
1887:
1888:                }
1889:            }
1890:
1891:            public void revokeWorkspaceSinkDP(IWorkspaceEventsSink sink)
1892:                    throws InvalidArguments {
1893:                if (sink != null) {
1894:                    IWorkspaceEventDispatcher dispatcher = getWorkspaceDispatcherDP();
1895:                    dispatcher.revokeWorkspaceSink(sink);
1896:                } else {
1897:                    throw new InvalidArguments();
1898:                }
1899:            }
1900:
1901:            public void registerForWSProjectEventsDP(IWSProjectEventsSink sink) {
1902:                if (sink != null) {
1903:                    IWorkspaceEventDispatcher dispatcher = getWorkspaceDispatcherDP();
1904:                    if (dispatcher != null) {
1905:                        dispatcher.registerForWSProjectEvents(sink);
1906:                    }
1907:
1908:                } else {
1909:                    // TODO: I need to notify the caller that the register failed.          
1910:                }
1911:            }
1912:
1913:            public void revokeWSProjectSinkDP(IWSProjectEventsSink sink)
1914:                    throws InvalidArguments {
1915:                if (sink != null) {
1916:                    IWorkspaceEventDispatcher dispatcher = getWorkspaceDispatcherDP();
1917:                    dispatcher.revokeWSProjectSink(sink);
1918:                } else {
1919:                    throw new InvalidArguments();
1920:                }
1921:            }
1922:
1923:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.