Source Code Cross Referenced for ModelItemProviderAdapterFactory.java in  » GIS » udig-1.1 » net » refractions » udig » printing » model » provider » 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 » GIS » udig 1.1 » net.refractions.udig.printing.model.provider 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /**
002:         * <copyright>
003:         * </copyright>
004:         *
005:         * $Id: ModelItemProviderAdapterFactory.java 18043 2006-02-15 19:03:03Z jeichar $
006:         */package net.refractions.udig.printing.model.provider;
007:
008:        import java.util.ArrayList;
009:        import java.util.Collection;
010:
011:        import net.refractions.udig.printing.model.util.ModelAdapterFactory;
012:
013:        import org.eclipse.emf.common.notify.Adapter;
014:        import org.eclipse.emf.common.notify.Notification;
015:        import org.eclipse.emf.common.notify.Notifier;
016:        import org.eclipse.emf.edit.provider.ChangeNotifier;
017:        import org.eclipse.emf.edit.provider.ComposeableAdapterFactory;
018:        import org.eclipse.emf.edit.provider.ComposedAdapterFactory;
019:        import org.eclipse.emf.edit.provider.IChangeNotifier;
020:        import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
021:        import org.eclipse.emf.edit.provider.IItemLabelProvider;
022:        import org.eclipse.emf.edit.provider.IItemPropertySource;
023:        import org.eclipse.emf.edit.provider.INotifyChangedListener;
024:        import org.eclipse.emf.edit.provider.IStructuredItemContentProvider;
025:        import org.eclipse.emf.edit.provider.ITreeItemContentProvider;
026:
027:        /**
028:         * This is the factory that is used to provide the interfaces needed to support Viewers.
029:         * The adapters generated by this factory convert EMF adapter notifications into calls to {@link #fireNotifyChanged fireNotifyChanged}.
030:         * The adapters also support Eclipse property sheets.
031:         * Note that most of the adapters are shared among multiple instances.
032:         * <!-- begin-user-doc -->
033:         * <!-- end-user-doc -->
034:         * @generated
035:         */
036:        public class ModelItemProviderAdapterFactory extends
037:                ModelAdapterFactory implements  ComposeableAdapterFactory,
038:                IChangeNotifier {
039:            /**
040:             * This keeps track of the root adapter factory that delegates to this adapter factory.
041:             * <!-- begin-user-doc -->
042:             * <!-- end-user-doc -->
043:             * @generated
044:             */
045:            protected ComposedAdapterFactory parentAdapterFactory;
046:
047:            /**
048:             * This is used to implement {@link org.eclipse.emf.edit.provider.IChangeNotifier}.
049:             * <!-- begin-user-doc -->
050:             * <!-- end-user-doc -->
051:             * @generated
052:             */
053:            protected IChangeNotifier changeNotifier = new ChangeNotifier();
054:
055:            /**
056:             * This keeps track of all the supported types checked by {@link #isFactoryForType isFactoryForType}.
057:             * <!-- begin-user-doc -->
058:             * <!-- end-user-doc -->
059:             * @generated
060:             */
061:            protected Collection supportedTypes = new ArrayList();
062:
063:            /**
064:             * This constructs an instance.
065:             * <!-- begin-user-doc -->
066:             * <!-- end-user-doc -->
067:             * @generated
068:             */
069:            public ModelItemProviderAdapterFactory() {
070:                supportedTypes.add(IEditingDomainItemProvider.class);
071:                supportedTypes.add(IStructuredItemContentProvider.class);
072:                supportedTypes.add(ITreeItemContentProvider.class);
073:                supportedTypes.add(IItemLabelProvider.class);
074:                supportedTypes.add(IItemPropertySource.class);
075:            }
076:
077:            /**
078:             * This keeps track of the one adapter used for all {@link net.refractions.udig.printing.model.Box} instances.
079:             * <!-- begin-user-doc -->
080:             * <!-- end-user-doc -->
081:             * @generated
082:             */
083:            protected BoxItemProvider boxItemProvider;
084:
085:            /**
086:             * This creates an adapter for a {@link net.refractions.udig.printing.model.Box}.
087:             * <!-- begin-user-doc -->
088:             * <!-- end-user-doc -->
089:             * @generated
090:             */
091:            public Adapter createBoxAdapter() {
092:                if (boxItemProvider == null) {
093:                    boxItemProvider = new BoxItemProvider(this );
094:                }
095:
096:                return boxItemProvider;
097:            }
098:
099:            /**
100:             * This keeps track of the one adapter used for all {@link net.refractions.udig.printing.model.Connection} instances.
101:             * <!-- begin-user-doc -->
102:             * <!-- end-user-doc -->
103:             * @generated
104:             */
105:            protected ConnectionItemProvider connectionItemProvider;
106:
107:            /**
108:             * This creates an adapter for a {@link net.refractions.udig.printing.model.Connection}.
109:             * <!-- begin-user-doc -->
110:             * <!-- end-user-doc -->
111:             * @generated
112:             */
113:            public Adapter createConnectionAdapter() {
114:                if (connectionItemProvider == null) {
115:                    connectionItemProvider = new ConnectionItemProvider(this );
116:                }
117:
118:                return connectionItemProvider;
119:            }
120:
121:            /**
122:             * This keeps track of the one adapter used for all {@link net.refractions.udig.printing.model.DecoratorBox} instances.
123:             * <!-- begin-user-doc -->
124:             * <!-- end-user-doc -->
125:             * @generated
126:             */
127:            protected DecoratorBoxItemProvider decoratorBoxItemProvider;
128:
129:            /**
130:             * This creates an adapter for a {@link net.refractions.udig.printing.model.DecoratorBox}.
131:             * <!-- begin-user-doc -->
132:             * <!-- end-user-doc -->
133:             * @generated
134:             */
135:            public Adapter createDecoratorBoxAdapter() {
136:                if (decoratorBoxItemProvider == null) {
137:                    decoratorBoxItemProvider = new DecoratorBoxItemProvider(
138:                            this );
139:                }
140:
141:                return decoratorBoxItemProvider;
142:            }
143:
144:            /**
145:             * This keeps track of the one adapter used for all {@link net.refractions.udig.printing.model.Element} instances.
146:             * <!-- begin-user-doc -->
147:             * <!-- end-user-doc -->
148:             * @generated
149:             */
150:            protected ElementItemProvider elementItemProvider;
151:
152:            /**
153:             * This creates an adapter for a {@link net.refractions.udig.printing.model.Element}.
154:             * <!-- begin-user-doc -->
155:             * <!-- end-user-doc -->
156:             * @generated
157:             */
158:            public Adapter createElementAdapter() {
159:                if (elementItemProvider == null) {
160:                    elementItemProvider = new ElementItemProvider(this );
161:                }
162:
163:                return elementItemProvider;
164:            }
165:
166:            /**
167:             * This keeps track of the one adapter used for all {@link net.refractions.udig.printing.model.Page} instances.
168:             * <!-- begin-user-doc -->
169:             * <!-- end-user-doc -->
170:             * @generated
171:             */
172:            protected PageItemProvider pageItemProvider;
173:
174:            /**
175:             * This creates an adapter for a {@link net.refractions.udig.printing.model.Page}.
176:             * <!-- begin-user-doc -->
177:             * <!-- end-user-doc -->
178:             * @generated
179:             */
180:            public Adapter createPageAdapter() {
181:                if (pageItemProvider == null) {
182:                    pageItemProvider = new PageItemProvider(this );
183:                }
184:
185:                return pageItemProvider;
186:            }
187:
188:            /**
189:             * This returns the root adapter factory that contains this factory.
190:             * <!-- begin-user-doc -->
191:             * <!-- end-user-doc -->
192:             * @generated
193:             */
194:            public ComposeableAdapterFactory getRootAdapterFactory() {
195:                return parentAdapterFactory == null ? this 
196:                        : parentAdapterFactory.getRootAdapterFactory();
197:            }
198:
199:            /**
200:             * This sets the composed adapter factory that contains this factory.
201:             * <!-- begin-user-doc -->
202:             * <!-- end-user-doc -->
203:             * @generated
204:             */
205:            public void setParentAdapterFactory(
206:                    ComposedAdapterFactory parentAdapterFactory) {
207:                this .parentAdapterFactory = parentAdapterFactory;
208:            }
209:
210:            /**
211:             * <!-- begin-user-doc -->
212:             * <!-- end-user-doc -->
213:             * @generated
214:             */
215:            public boolean isFactoryForType(Object type) {
216:                return supportedTypes.contains(type)
217:                        || super .isFactoryForType(type);
218:            }
219:
220:            /**
221:             * This implementation substitutes the factory itself as the key for the adapter.
222:             * <!-- begin-user-doc -->
223:             * <!-- end-user-doc -->
224:             * @generated
225:             */
226:            public Adapter adapt(Notifier notifier, Object type) {
227:                return super .adapt(notifier, this );
228:            }
229:
230:            /**
231:             * <!-- begin-user-doc -->
232:             * <!-- end-user-doc -->
233:             * @generated
234:             */
235:            public Object adapt(Object object, Object type) {
236:                if (isFactoryForType(type)) {
237:                    Object adapter = super .adapt(object, type);
238:                    if (!(type instanceof  Class)
239:                            || (((Class) type).isInstance(adapter))) {
240:                        return adapter;
241:                    }
242:                }
243:
244:                return null;
245:            }
246:
247:            /**
248:             * This adds a listener.
249:             * <!-- begin-user-doc -->
250:             * <!-- end-user-doc -->
251:             * @generated
252:             */
253:            public void addListener(INotifyChangedListener notifyChangedListener) {
254:                changeNotifier.addListener(notifyChangedListener);
255:            }
256:
257:            /**
258:             * This removes a listener.
259:             * <!-- begin-user-doc -->
260:             * <!-- end-user-doc -->
261:             * @generated
262:             */
263:            public void removeListener(
264:                    INotifyChangedListener notifyChangedListener) {
265:                changeNotifier.removeListener(notifyChangedListener);
266:            }
267:
268:            /**
269:             * This delegates to {@link #changeNotifier} and to {@link #parentAdapterFactory}.
270:             * <!-- begin-user-doc -->
271:             * <!-- end-user-doc -->
272:             * @generated
273:             */
274:            public void fireNotifyChanged(Notification notification) {
275:                changeNotifier.fireNotifyChanged(notification);
276:
277:                if (parentAdapterFactory != null) {
278:                    parentAdapterFactory.fireNotifyChanged(notification);
279:                }
280:            }
281:
282:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.