KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > emf > codegen > ecore > genmodel > impl > GenModelImpl


1 /**
2  * <copyright>
3  *
4  * Copyright (c) 2002-2005 IBM Corporation and others.
5  * All rights reserved. This program and the accompanying materials
6  * are made available under the terms of the Eclipse Public License v1.0
7  * which accompanies this distribution, and is available at
8  * http://www.eclipse.org/legal/epl-v10.html
9  *
10  * Contributors:
11  * IBM - Initial API and implementation
12  *
13  * </copyright>
14  *
15  * $Id: GenModelImpl.java,v 1.45 2005/06/28 23:50:25 marcelop Exp $
16  */

17 package org.eclipse.emf.codegen.ecore.genmodel.impl;
18
19
20 import java.lang.reflect.Method JavaDoc;
21 import java.util.ArrayList JavaDoc;
22 import java.util.Collection JavaDoc;
23 import java.util.Collections JavaDoc;
24 import java.util.HashSet JavaDoc;
25 import java.util.Iterator JavaDoc;
26 import java.util.List JavaDoc;
27 import java.util.ListIterator JavaDoc;
28 import java.util.Map JavaDoc;
29 import java.util.Set JavaDoc;
30
31 import org.eclipse.core.runtime.IProgressMonitor;
32 import org.eclipse.core.runtime.IStatus;
33 import org.eclipse.core.runtime.MultiStatus;
34 import org.eclipse.core.runtime.Path;
35 import org.eclipse.core.runtime.Status;
36 import org.eclipse.core.runtime.SubProgressMonitor;
37 import org.eclipse.jdt.core.ToolFactory;
38 import org.eclipse.jdt.core.formatter.CodeFormatter;
39
40 import org.eclipse.emf.codegen.ecore.CodeGenEcorePlugin;
41 import org.eclipse.emf.codegen.ecore.Generator;
42 import org.eclipse.emf.codegen.ecore.genmodel.GenClass;
43 import org.eclipse.emf.codegen.ecore.genmodel.GenDataType;
44 import org.eclipse.emf.codegen.ecore.genmodel.GenEnum;
45 import org.eclipse.emf.codegen.ecore.genmodel.GenEnumLiteral;
46 import org.eclipse.emf.codegen.ecore.genmodel.GenFeature;
47 import org.eclipse.emf.codegen.ecore.genmodel.GenModel;
48 import org.eclipse.emf.codegen.ecore.genmodel.GenModelFactory;
49 import org.eclipse.emf.codegen.ecore.genmodel.GenModelPackage;
50 import org.eclipse.emf.codegen.ecore.genmodel.GenOperation;
51 import org.eclipse.emf.codegen.ecore.genmodel.GenPackage;
52 import org.eclipse.emf.codegen.ecore.genmodel.GenParameter;
53 import org.eclipse.emf.codegen.ecore.genmodel.GenResourceKind;
54 import org.eclipse.emf.codegen.jet.JETCompiler;
55 import org.eclipse.emf.codegen.jet.JETEmitter;
56 import org.eclipse.emf.codegen.jet.JETException;
57 import org.eclipse.emf.codegen.jmerge.JControlModel;
58 import org.eclipse.emf.codegen.util.CodeGenUtil;
59 import org.eclipse.emf.codegen.util.ImportManager;
60 import org.eclipse.emf.common.notify.Notification;
61 import org.eclipse.emf.common.notify.NotificationChain;
62 import org.eclipse.emf.common.util.AbstractTreeIterator;
63 import org.eclipse.emf.common.util.ECollections;
64 import org.eclipse.emf.common.util.EList;
65 import org.eclipse.emf.common.util.TreeIterator;
66 import org.eclipse.emf.common.util.URI;
67 import org.eclipse.emf.common.util.UniqueEList;
68 import org.eclipse.emf.ecore.EClass;
69 import org.eclipse.emf.ecore.EClassifier;
70 import org.eclipse.emf.ecore.EModelElement;
71 import org.eclipse.emf.ecore.EObject;
72 import org.eclipse.emf.ecore.EPackage;
73 import org.eclipse.emf.ecore.EStructuralFeature;
74 import org.eclipse.emf.ecore.EcorePackage;
75 import org.eclipse.emf.ecore.InternalEObject;
76 import org.eclipse.emf.ecore.impl.ENotificationImpl;
77 import org.eclipse.emf.ecore.util.BasicExtendedMetaData;
78 import org.eclipse.emf.ecore.util.EDataTypeUniqueEList;
79 import org.eclipse.emf.ecore.util.EObjectContainmentWithInverseEList;
80 import org.eclipse.emf.ecore.util.EObjectResolvingEList;
81 import org.eclipse.emf.ecore.util.EcoreUtil;
82 import org.eclipse.emf.ecore.util.ExtendedMetaData;
83 import org.eclipse.emf.ecore.util.InternalEList;
84
85
86 /**
87  * <!-- begin-user-doc -->
88  * An implementation of the model object '<em><b>GenModel</b></em>'.
89  * <!-- end-user-doc -->
90  * <p>
91  * The following features are implemented:
92  * <ul>
93  * <li>{@link org.eclipse.emf.codegen.ecore.genmodel.impl.GenModelImpl#getCopyrightText <em>Copyright Text</em>}</li>
94  * <li>{@link org.eclipse.emf.codegen.ecore.genmodel.impl.GenModelImpl#getModelDirectory <em>Model Directory</em>}</li>
95  * <li>{@link org.eclipse.emf.codegen.ecore.genmodel.impl.GenModelImpl#isCreationCommands <em>Creation Commands</em>}</li>
96  * <li>{@link org.eclipse.emf.codegen.ecore.genmodel.impl.GenModelImpl#isCreationIcons <em>Creation Icons</em>}</li>
97  * <li>{@link org.eclipse.emf.codegen.ecore.genmodel.impl.GenModelImpl#getEditDirectory <em>Edit Directory</em>}</li>
98  * <li>{@link org.eclipse.emf.codegen.ecore.genmodel.impl.GenModelImpl#getEditorDirectory <em>Editor Directory</em>}</li>
99  * <li>{@link org.eclipse.emf.codegen.ecore.genmodel.impl.GenModelImpl#getModelPluginID <em>Model Plugin ID</em>}</li>
100  * <li>{@link org.eclipse.emf.codegen.ecore.genmodel.impl.GenModelImpl#getTemplateDirectory <em>Template Directory</em>}</li>
101  * <li>{@link org.eclipse.emf.codegen.ecore.genmodel.impl.GenModelImpl#isRuntimeJar <em>Runtime Jar</em>}</li>
102  * <li>{@link org.eclipse.emf.codegen.ecore.genmodel.impl.GenModelImpl#getForeignModel <em>Foreign Model</em>}</li>
103  * <li>{@link org.eclipse.emf.codegen.ecore.genmodel.impl.GenModelImpl#isDynamicTemplates <em>Dynamic Templates</em>}</li>
104  * <li>{@link org.eclipse.emf.codegen.ecore.genmodel.impl.GenModelImpl#getRedirection <em>Redirection</em>}</li>
105  * <li>{@link org.eclipse.emf.codegen.ecore.genmodel.impl.GenModelImpl#isForceOverwrite <em>Force Overwrite</em>}</li>
106  * <li>{@link org.eclipse.emf.codegen.ecore.genmodel.impl.GenModelImpl#getNonExternalizedStringTag <em>Non Externalized String Tag</em>}</li>
107  * <li>{@link org.eclipse.emf.codegen.ecore.genmodel.impl.GenModelImpl#getModelName <em>Model Name</em>}</li>
108  * <li>{@link org.eclipse.emf.codegen.ecore.genmodel.impl.GenModelImpl#getModelPluginClass <em>Model Plugin Class</em>}</li>
109  * <li>{@link org.eclipse.emf.codegen.ecore.genmodel.impl.GenModelImpl#getEditPluginClass <em>Edit Plugin Class</em>}</li>
110  * <li>{@link org.eclipse.emf.codegen.ecore.genmodel.impl.GenModelImpl#getEditorPluginClass <em>Editor Plugin Class</em>}</li>
111  * <li>{@link org.eclipse.emf.codegen.ecore.genmodel.impl.GenModelImpl#isUpdateClasspath <em>Update Classpath</em>}</li>
112  * <li>{@link org.eclipse.emf.codegen.ecore.genmodel.impl.GenModelImpl#isGenerateSchema <em>Generate Schema</em>}</li>
113  * <li>{@link org.eclipse.emf.codegen.ecore.genmodel.impl.GenModelImpl#isNonNLSMarkers <em>Non NLS Markers</em>}</li>
114  * <li>{@link org.eclipse.emf.codegen.ecore.genmodel.impl.GenModelImpl#getStaticPackages <em>Static Packages</em>}</li>
115  * <li>{@link org.eclipse.emf.codegen.ecore.genmodel.impl.GenModelImpl#getModelPluginVariables <em>Model Plugin Variables</em>}</li>
116  * <li>{@link org.eclipse.emf.codegen.ecore.genmodel.impl.GenModelImpl#getRootExtendsInterface <em>Root Extends Interface</em>}</li>
117  * <li>{@link org.eclipse.emf.codegen.ecore.genmodel.impl.GenModelImpl#getRootExtendsClass <em>Root Extends Class</em>}</li>
118  * <li>{@link org.eclipse.emf.codegen.ecore.genmodel.impl.GenModelImpl#getRootImplementsInterface <em>Root Implements Interface</em>}</li>
119  * <li>{@link org.eclipse.emf.codegen.ecore.genmodel.impl.GenModelImpl#isSuppressEMFTypes <em>Suppress EMF Types</em>}</li>
120  * <li>{@link org.eclipse.emf.codegen.ecore.genmodel.impl.GenModelImpl#getFeatureMapWrapperInterface <em>Feature Map Wrapper Interface</em>}</li>
121  * <li>{@link org.eclipse.emf.codegen.ecore.genmodel.impl.GenModelImpl#getFeatureMapWrapperInternalInterface <em>Feature Map Wrapper Internal Interface</em>}</li>
122  * <li>{@link org.eclipse.emf.codegen.ecore.genmodel.impl.GenModelImpl#getFeatureMapWrapperClass <em>Feature Map Wrapper Class</em>}</li>
123  * <li>{@link org.eclipse.emf.codegen.ecore.genmodel.impl.GenModelImpl#isRuntimeCompatibility <em>Runtime Compatibility</em>}</li>
124  * <li>{@link org.eclipse.emf.codegen.ecore.genmodel.impl.GenModelImpl#isRichClientPlatform <em>Rich Client Platform</em>}</li>
125  * <li>{@link org.eclipse.emf.codegen.ecore.genmodel.impl.GenModelImpl#isReflectiveDelegation <em>Reflective Delegation</em>}</li>
126  * <li>{@link org.eclipse.emf.codegen.ecore.genmodel.impl.GenModelImpl#isCodeFormatting <em>Code Formatting</em>}</li>
127  * <li>{@link org.eclipse.emf.codegen.ecore.genmodel.impl.GenModelImpl#getTestsDirectory <em>Tests Directory</em>}</li>
128  * <li>{@link org.eclipse.emf.codegen.ecore.genmodel.impl.GenModelImpl#getTestSuiteClass <em>Test Suite Class</em>}</li>
129  * <li>{@link org.eclipse.emf.codegen.ecore.genmodel.impl.GenModelImpl#getBooleanFlagsField <em>Boolean Flags Field</em>}</li>
130  * <li>{@link org.eclipse.emf.codegen.ecore.genmodel.impl.GenModelImpl#getBooleanFlagsReservedBits <em>Boolean Flags Reserved Bits</em>}</li>
131  * <li>{@link org.eclipse.emf.codegen.ecore.genmodel.impl.GenModelImpl#getImporterID <em>Importer ID</em>}</li>
132  * <li>{@link org.eclipse.emf.codegen.ecore.genmodel.impl.GenModelImpl#isBundleManifest <em>Bundle Manifest</em>}</li>
133  * <li>{@link org.eclipse.emf.codegen.ecore.genmodel.impl.GenModelImpl#getGenPackages <em>Gen Packages</em>}</li>
134  * <li>{@link org.eclipse.emf.codegen.ecore.genmodel.impl.GenModelImpl#getUsedGenPackages <em>Used Gen Packages</em>}</li>
135  * </ul>
136  * </p>
137  *
138  * @generated
139  */

140 public class GenModelImpl extends GenBaseImpl implements GenModel
141 {
142   /**
143    * The default value of the '{@link #getCopyrightText() <em>Copyright Text</em>}' attribute.
144    * <!-- begin-user-doc -->
145    * <!-- end-user-doc -->
146    * @see #getCopyrightText()
147    * @generated
148    * @ordered
149    */

150   protected static final String JavaDoc COPYRIGHT_TEXT_EDEFAULT = null;
151
152   /**
153    * The cached value of the '{@link #getCopyrightText() <em>Copyright Text</em>}' attribute.
154    * <!-- begin-user-doc -->
155    * <!-- end-user-doc -->
156    * @see #getCopyrightText()
157    * @generated
158    * @ordered
159    */

160   protected String JavaDoc copyrightText = COPYRIGHT_TEXT_EDEFAULT;
161
162   /**
163    * The default value of the '{@link #getModelDirectory() <em>Model Directory</em>}' attribute.
164    * <!-- begin-user-doc -->
165    * <!-- end-user-doc -->
166    * @see #getModelDirectory()
167    * @generated
168    * @ordered
169    */

170   protected static final String JavaDoc MODEL_DIRECTORY_EDEFAULT = null;
171
172   /**
173    * The cached value of the '{@link #getModelDirectory() <em>Model Directory</em>}' attribute.
174    * <!-- begin-user-doc -->
175    * <!-- end-user-doc -->
176    * @see #getModelDirectory()
177    * @generated
178    * @ordered
179    */

180   protected String JavaDoc modelDirectory = MODEL_DIRECTORY_EDEFAULT;
181
182   /**
183    * The default value of the '{@link #isCreationCommands() <em>Creation Commands</em>}' attribute.
184    * <!-- begin-user-doc -->
185    * <!-- end-user-doc -->
186    * @see #isCreationCommands()
187    * @generated
188    * @ordered
189    */

190   protected static final boolean CREATION_COMMANDS_EDEFAULT = true;
191
192   /**
193    * The cached value of the '{@link #isCreationCommands() <em>Creation Commands</em>}' attribute.
194    * <!-- begin-user-doc -->
195    * <!-- end-user-doc -->
196    * @see #isCreationCommands()
197    * @generated
198    * @ordered
199    */

200   protected boolean creationCommands = CREATION_COMMANDS_EDEFAULT;
201
202   /**
203    * The default value of the '{@link #isCreationIcons() <em>Creation Icons</em>}' attribute.
204    * <!-- begin-user-doc -->
205    * <!-- end-user-doc -->
206    * @see #isCreationIcons()
207    * @generated
208    * @ordered
209    */

210   protected static final boolean CREATION_ICONS_EDEFAULT = true;
211
212   /**
213    * The cached value of the '{@link #isCreationIcons() <em>Creation Icons</em>}' attribute.
214    * <!-- begin-user-doc -->
215    * <!-- end-user-doc -->
216    * @see #isCreationIcons()
217    * @generated
218    * @ordered
219    */

220   protected boolean creationIcons = CREATION_ICONS_EDEFAULT;
221
222   /**
223    * The default value of the '{@link #getEditDirectory() <em>Edit Directory</em>}' attribute.
224    * <!-- begin-user-doc -->
225    * <!-- end-user-doc -->
226    * @see #getEditDirectory()
227    * @generated
228    * @ordered
229    */

230   protected static final String JavaDoc EDIT_DIRECTORY_EDEFAULT = null;
231
232   /**
233    * The cached value of the '{@link #getEditDirectory() <em>Edit Directory</em>}' attribute.
234    * <!-- begin-user-doc -->
235    * <!-- end-user-doc -->
236    * @see #getEditDirectory()
237    * @generated
238    * @ordered
239    */

240   protected String JavaDoc editDirectory = EDIT_DIRECTORY_EDEFAULT;
241
242   /**
243    * This is true if the Edit Directory attribute has been set.
244    * <!-- begin-user-doc -->
245    * <!-- end-user-doc -->
246    * @generated
247    * @ordered
248    */

249   protected boolean editDirectoryESet = false;
250
251   /**
252    * The default value of the '{@link #getEditorDirectory() <em>Editor Directory</em>}' attribute.
253    * <!-- begin-user-doc -->
254    * <!-- end-user-doc -->
255    * @see #getEditorDirectory()
256    * @generated
257    * @ordered
258    */

259   protected static final String JavaDoc EDITOR_DIRECTORY_EDEFAULT = null;
260
261   /**
262    * The cached value of the '{@link #getEditorDirectory() <em>Editor Directory</em>}' attribute.
263    * <!-- begin-user-doc -->
264    * <!-- end-user-doc -->
265    * @see #getEditorDirectory()
266    * @generated
267    * @ordered
268    */

269   protected String JavaDoc editorDirectory = EDITOR_DIRECTORY_EDEFAULT;
270
271   /**
272    * This is true if the Editor Directory attribute has been set.
273    * <!-- begin-user-doc -->
274    * <!-- end-user-doc -->
275    * @generated
276    * @ordered
277    */

278   protected boolean editorDirectoryESet = false;
279
280   /**
281    * The default value of the '{@link #getModelPluginID() <em>Model Plugin ID</em>}' attribute.
282    * <!-- begin-user-doc -->
283    * <!-- end-user-doc -->
284    * @see #getModelPluginID()
285    * @generated
286    * @ordered
287    */

288   protected static final String JavaDoc MODEL_PLUGIN_ID_EDEFAULT = null;
289
290   /**
291    * The cached value of the '{@link #getModelPluginID() <em>Model Plugin ID</em>}' attribute.
292    * <!-- begin-user-doc -->
293    * <!-- end-user-doc -->
294    * @see #getModelPluginID()
295    * @generated
296    * @ordered
297    */

298   protected String JavaDoc modelPluginID = MODEL_PLUGIN_ID_EDEFAULT;
299
300   /**
301    * The default value of the '{@link #getTemplateDirectory() <em>Template Directory</em>}' attribute.
302    * <!-- begin-user-doc -->
303    * <!-- end-user-doc -->
304    * @see #getTemplateDirectory()
305    * @generated
306    * @ordered
307    */

308   protected static final String JavaDoc TEMPLATE_DIRECTORY_EDEFAULT = null;
309
310   /**
311    * The cached value of the '{@link #getTemplateDirectory() <em>Template Directory</em>}' attribute.
312    * <!-- begin-user-doc -->
313    * <!-- end-user-doc -->
314    * @see #getTemplateDirectory()
315    * @generated
316    * @ordered
317    */

318   protected String JavaDoc templateDirectory = TEMPLATE_DIRECTORY_EDEFAULT;
319
320   /**
321    * The default value of the '{@link #isRuntimeJar() <em>Runtime Jar</em>}' attribute.
322    * <!-- begin-user-doc -->
323    * <!-- end-user-doc -->
324    * @see #isRuntimeJar()
325    * @generated
326    * @ordered
327    */

328   protected static final boolean RUNTIME_JAR_EDEFAULT = false;
329
330   /**
331    * The cached value of the '{@link #isRuntimeJar() <em>Runtime Jar</em>}' attribute.
332    * <!-- begin-user-doc -->
333    * <!-- end-user-doc -->
334    * @see #isRuntimeJar()
335    * @generated
336    * @ordered
337    */

338   protected boolean runtimeJar = RUNTIME_JAR_EDEFAULT;
339
340   /**
341    * The cached value of the '{@link #getForeignModel() <em>Foreign Model</em>}' attribute list.
342    * <!-- begin-user-doc -->
343    * <!-- end-user-doc -->
344    * @see #getForeignModel()
345    * @generated
346    * @ordered
347    */

348   protected EList foreignModel = null;
349
350   /**
351    * The default value of the '{@link #isDynamicTemplates() <em>Dynamic Templates</em>}' attribute.
352    * <!-- begin-user-doc -->
353    * <!-- end-user-doc -->
354    * @see #isDynamicTemplates()
355    * @generated
356    * @ordered
357    */

358   protected static final boolean DYNAMIC_TEMPLATES_EDEFAULT = false;
359
360   /**
361    * The cached value of the '{@link #isDynamicTemplates() <em>Dynamic Templates</em>}' attribute.
362    * <!-- begin-user-doc -->
363    * <!-- end-user-doc -->
364    * @see #isDynamicTemplates()
365    * @generated
366    * @ordered
367    */

368   protected boolean dynamicTemplates = DYNAMIC_TEMPLATES_EDEFAULT;
369
370   /**
371    * The default value of the '{@link #getRedirection() <em>Redirection</em>}' attribute.
372    * <!-- begin-user-doc -->
373    * <!-- end-user-doc -->
374    * @see #getRedirection()
375    * @generated
376    * @ordered
377    */

378   protected static final String JavaDoc REDIRECTION_EDEFAULT = null;
379
380   /**
381    * The cached value of the '{@link #getRedirection() <em>Redirection</em>}' attribute.
382    * <!-- begin-user-doc -->
383    * <!-- end-user-doc -->
384    * @see #getRedirection()
385    * @generated
386    * @ordered
387    */

388   protected String JavaDoc redirection = REDIRECTION_EDEFAULT;
389
390   /**
391    * The default value of the '{@link #isForceOverwrite() <em>Force Overwrite</em>}' attribute.
392    * <!-- begin-user-doc -->
393    * <!-- end-user-doc -->
394    * @see #isForceOverwrite()
395    * @generated
396    * @ordered
397    */

398   protected static final boolean FORCE_OVERWRITE_EDEFAULT = false;
399
400   /**
401    * The cached value of the '{@link #isForceOverwrite() <em>Force Overwrite</em>}' attribute.
402    * <!-- begin-user-doc -->
403    * <!-- end-user-doc -->
404    * @see #isForceOverwrite()
405    * @generated
406    * @ordered
407    */

408   protected boolean forceOverwrite = FORCE_OVERWRITE_EDEFAULT;
409
410   /**
411    * The default value of the '{@link #getNonExternalizedStringTag() <em>Non Externalized String Tag</em>}' attribute.
412    * <!-- begin-user-doc -->
413    * <!-- end-user-doc -->
414    * @see #getNonExternalizedStringTag()
415    * @generated
416    * @ordered
417    */

418   protected static final String JavaDoc NON_EXTERNALIZED_STRING_TAG_EDEFAULT = null;
419
420   /**
421    * The cached value of the '{@link #getNonExternalizedStringTag() <em>Non Externalized String Tag</em>}' attribute.
422    * <!-- begin-user-doc -->
423    * <!-- end-user-doc -->
424    * @see #getNonExternalizedStringTag()
425    * @generated
426    * @ordered
427    */

428   protected String JavaDoc nonExternalizedStringTag = NON_EXTERNALIZED_STRING_TAG_EDEFAULT;
429
430   /**
431    * The default value of the '{@link #getModelName() <em>Model Name</em>}' attribute.
432    * <!-- begin-user-doc -->
433    * <!-- end-user-doc -->
434    * @see #getModelName()
435    * @generated
436    * @ordered
437    */

438   protected static final String JavaDoc MODEL_NAME_EDEFAULT = null;
439
440   /**
441    * The cached value of the '{@link #getModelName() <em>Model Name</em>}' attribute.
442    * <!-- begin-user-doc -->
443    * <!-- end-user-doc -->
444    * @see #getModelName()
445    * @generated
446    * @ordered
447    */

448   protected String JavaDoc modelName = MODEL_NAME_EDEFAULT;
449
450   /**
451    * The default value of the '{@link #getModelPluginClass() <em>Model Plugin Class</em>}' attribute.
452    * <!-- begin-user-doc -->
453    * <!-- end-user-doc -->
454    * @see #getModelPluginClass()
455    * @generated
456    * @ordered
457    */

458   protected static final String JavaDoc MODEL_PLUGIN_CLASS_EDEFAULT = null;
459
460   /**
461    * The cached value of the '{@link #getModelPluginClass() <em>Model Plugin Class</em>}' attribute.
462    * <!-- begin-user-doc -->
463    * <!-- end-user-doc -->
464    * @see #getModelPluginClass()
465    * @generated
466    * @ordered
467    */

468   protected String JavaDoc modelPluginClass = MODEL_PLUGIN_CLASS_EDEFAULT;
469
470   /**
471    * The default value of the '{@link #getEditPluginClass() <em>Edit Plugin Class</em>}' attribute.
472    * <!-- begin-user-doc -->
473    * <!-- end-user-doc -->
474    * @see #getEditPluginClass()
475    * @generated
476    * @ordered
477    */

478   protected static final String JavaDoc EDIT_PLUGIN_CLASS_EDEFAULT = null;
479
480   /**
481    * The cached value of the '{@link #getEditPluginClass() <em>Edit Plugin Class</em>}' attribute.
482    * <!-- begin-user-doc -->
483    * <!-- end-user-doc -->
484    * @see #getEditPluginClass()
485    * @generated
486    * @ordered
487    */

488   protected String JavaDoc editPluginClass = EDIT_PLUGIN_CLASS_EDEFAULT;
489
490   /**
491    * This is true if the Edit Plugin Class attribute has been set.
492    * <!-- begin-user-doc -->
493    * <!-- end-user-doc -->
494    * @generated
495    * @ordered
496    */

497   protected boolean editPluginClassESet = false;
498
499   /**
500    * The default value of the '{@link #getEditorPluginClass() <em>Editor Plugin Class</em>}' attribute.
501    * <!-- begin-user-doc -->
502    * <!-- end-user-doc -->
503    * @see #getEditorPluginClass()
504    * @generated
505    * @ordered
506    */

507   protected static final String JavaDoc EDITOR_PLUGIN_CLASS_EDEFAULT = null;
508
509   /**
510    * The cached value of the '{@link #getEditorPluginClass() <em>Editor Plugin Class</em>}' attribute.
511    * <!-- begin-user-doc -->
512    * <!-- end-user-doc -->
513    * @see #getEditorPluginClass()
514    * @generated
515    * @ordered
516    */

517   protected String JavaDoc editorPluginClass = EDITOR_PLUGIN_CLASS_EDEFAULT;
518
519   /**
520    * This is true if the Editor Plugin Class attribute has been set.
521    * <!-- begin-user-doc -->
522    * <!-- end-user-doc -->
523    * @generated
524    * @ordered
525    */

526   protected boolean editorPluginClassESet = false;
527
528   /**
529    * The default value of the '{@link #isUpdateClasspath() <em>Update Classpath</em>}' attribute.
530    * <!-- begin-user-doc -->
531    * <!-- end-user-doc -->
532    * @see #isUpdateClasspath()
533    * @generated
534    * @ordered
535    */

536   protected static final boolean UPDATE_CLASSPATH_EDEFAULT = true;
537
538   /**
539    * The cached value of the '{@link #isUpdateClasspath() <em>Update Classpath</em>}' attribute.
540    * <!-- begin-user-doc -->
541    * <!-- end-user-doc -->
542    * @see #isUpdateClasspath()
543    * @generated
544    * @ordered
545    */

546   protected boolean updateClasspath = UPDATE_CLASSPATH_EDEFAULT;
547
548   /**
549    * The default value of the '{@link #isGenerateSchema() <em>Generate Schema</em>}' attribute.
550    * <!-- begin-user-doc -->
551    * <!-- end-user-doc -->
552    * @see #isGenerateSchema()
553    * @generated
554    * @ordered
555    */

556   protected static final boolean GENERATE_SCHEMA_EDEFAULT = false;
557
558   /**
559    * The cached value of the '{@link #isGenerateSchema() <em>Generate Schema</em>}' attribute.
560    * <!-- begin-user-doc -->
561    * <!-- end-user-doc -->
562    * @see #isGenerateSchema()
563    * @generated
564    * @ordered
565    */

566   protected boolean generateSchema = GENERATE_SCHEMA_EDEFAULT;
567
568   /**
569    * The default value of the '{@link #isNonNLSMarkers() <em>Non NLS Markers</em>}' attribute.
570    * <!-- begin-user-doc -->
571    * <!-- end-user-doc -->
572    * @see #isNonNLSMarkers()
573    * @generated
574    * @ordered
575    */

576   protected static final boolean NON_NLS_MARKERS_EDEFAULT = false;
577
578   /**
579    * The cached value of the '{@link #isNonNLSMarkers() <em>Non NLS Markers</em>}' attribute.
580    * <!-- begin-user-doc -->
581    * <!-- end-user-doc -->
582    * @see #isNonNLSMarkers()
583    * @generated
584    * @ordered
585    */

586   protected boolean nonNLSMarkers = NON_NLS_MARKERS_EDEFAULT;
587
588   /**
589    * The cached value of the '{@link #getStaticPackages() <em>Static Packages</em>}' attribute list.
590    * <!-- begin-user-doc -->
591    * <!-- end-user-doc -->
592    * @see #getStaticPackages()
593    * @generated
594    * @ordered
595    */

596   protected EList staticPackages = null;
597
598   /**
599    * The cached value of the '{@link #getModelPluginVariables() <em>Model Plugin Variables</em>}' attribute list.
600    * <!-- begin-user-doc -->
601    * <!-- end-user-doc -->
602    * @see #getModelPluginVariables()
603    * @generated
604    * @ordered
605    */

606   protected EList modelPluginVariables = null;
607
608   /**
609    * The default value of the '{@link #getRootExtendsInterface() <em>Root Extends Interface</em>}' attribute.
610    * <!-- begin-user-doc -->
611    * <!-- end-user-doc -->
612    * @see #getRootExtendsInterface()
613    * @generated
614    * @ordered
615    */

616   protected static final String JavaDoc ROOT_EXTENDS_INTERFACE_EDEFAULT = "org.eclipse.emf.ecore.EObject";
617
618   /**
619    * The cached value of the '{@link #getRootExtendsInterface() <em>Root Extends Interface</em>}' attribute.
620    * <!-- begin-user-doc -->
621    * <!-- end-user-doc -->
622    * @see #getRootExtendsInterface()
623    * @generated
624    * @ordered
625    */

626   protected String JavaDoc rootExtendsInterface = ROOT_EXTENDS_INTERFACE_EDEFAULT;
627
628   /**
629    * The default value of the '{@link #getRootExtendsClass() <em>Root Extends Class</em>}' attribute.
630    * <!-- begin-user-doc -->
631    * <!-- end-user-doc -->
632    * @see #getRootExtendsClass()
633    * @generated
634    * @ordered
635    */

636   protected static final String JavaDoc ROOT_EXTENDS_CLASS_EDEFAULT = "org.eclipse.emf.ecore.impl.EObjectImpl";
637
638   /**
639    * The cached value of the '{@link #getRootExtendsClass() <em>Root Extends Class</em>}' attribute.
640    * <!-- begin-user-doc -->
641    * <!-- end-user-doc -->
642    * @see #getRootExtendsClass()
643    * @generated
644    * @ordered
645    */

646   protected String JavaDoc rootExtendsClass = ROOT_EXTENDS_CLASS_EDEFAULT;
647
648   /**
649    * The default value of the '{@link #getRootImplementsInterface() <em>Root Implements Interface</em>}' attribute.
650    * <!-- begin-user-doc -->
651    * <!-- end-user-doc -->
652    * @see #getRootImplementsInterface()
653    * @generated
654    * @ordered
655    */

656   protected static final String JavaDoc ROOT_IMPLEMENTS_INTERFACE_EDEFAULT = null;
657
658   /**
659    * The cached value of the '{@link #getRootImplementsInterface() <em>Root Implements Interface</em>}' attribute.
660    * <!-- begin-user-doc -->
661    * <!-- end-user-doc -->
662    * @see #getRootImplementsInterface()
663    * @generated
664    * @ordered
665    */

666   protected String JavaDoc rootImplementsInterface = ROOT_IMPLEMENTS_INTERFACE_EDEFAULT;
667
668   /**
669    * The default value of the '{@link #isSuppressEMFTypes() <em>Suppress EMF Types</em>}' attribute.
670    * <!-- begin-user-doc -->
671    * <!-- end-user-doc -->
672    * @see #isSuppressEMFTypes()
673    * @generated
674    * @ordered
675    */

676   protected static final boolean SUPPRESS_EMF_TYPES_EDEFAULT = false;
677
678   /**
679    * The cached value of the '{@link #isSuppressEMFTypes() <em>Suppress EMF Types</em>}' attribute.
680    * <!-- begin-user-doc -->
681    * <!-- end-user-doc -->
682    * @see #isSuppressEMFTypes()
683    * @generated
684    * @ordered
685    */

686   protected boolean suppressEMFTypes = SUPPRESS_EMF_TYPES_EDEFAULT;
687
688   /**
689    * The default value of the '{@link #getFeatureMapWrapperInterface() <em>Feature Map Wrapper Interface</em>}' attribute.
690    * <!-- begin-user-doc -->
691    * <!-- end-user-doc -->
692    * @see #getFeatureMapWrapperInterface()
693    * @generated
694    * @ordered
695    */

696   protected static final String JavaDoc FEATURE_MAP_WRAPPER_INTERFACE_EDEFAULT = null;
697
698   /**
699    * The cached value of the '{@link #getFeatureMapWrapperInterface() <em>Feature Map Wrapper Interface</em>}' attribute.
700    * <!-- begin-user-doc -->
701    * <!-- end-user-doc -->
702    * @see #getFeatureMapWrapperInterface()
703    * @generated
704    * @ordered
705    */

706   protected String JavaDoc featureMapWrapperInterface = FEATURE_MAP_WRAPPER_INTERFACE_EDEFAULT;
707
708   /**
709    * The default value of the '{@link #getFeatureMapWrapperInternalInterface() <em>Feature Map Wrapper Internal Interface</em>}' attribute.
710    * <!-- begin-user-doc -->
711    * <!-- end-user-doc -->
712    * @see #getFeatureMapWrapperInternalInterface()
713    * @generated
714    * @ordered
715    */

716   protected static final String JavaDoc FEATURE_MAP_WRAPPER_INTERNAL_INTERFACE_EDEFAULT = null;
717
718   /**
719    * The cached value of the '{@link #getFeatureMapWrapperInternalInterface() <em>Feature Map Wrapper Internal Interface</em>}' attribute.
720    * <!-- begin-user-doc -->
721    * <!-- end-user-doc -->
722    * @see #getFeatureMapWrapperInternalInterface()
723    * @generated
724    * @ordered
725    */

726   protected String JavaDoc featureMapWrapperInternalInterface = FEATURE_MAP_WRAPPER_INTERNAL_INTERFACE_EDEFAULT;
727
728   /**
729    * The default value of the '{@link #getFeatureMapWrapperClass() <em>Feature Map Wrapper Class</em>}' attribute.
730    * <!-- begin-user-doc -->
731    * <!-- end-user-doc -->
732    * @see #getFeatureMapWrapperClass()
733    * @generated
734    * @ordered
735    */

736   protected static final String JavaDoc FEATURE_MAP_WRAPPER_CLASS_EDEFAULT = null;
737
738   /**
739    * The cached value of the '{@link #getFeatureMapWrapperClass() <em>Feature Map Wrapper Class</em>}' attribute.
740    * <!-- begin-user-doc -->
741    * <!-- end-user-doc -->
742    * @see #getFeatureMapWrapperClass()
743    * @generated
744    * @ordered
745    */

746   protected String JavaDoc featureMapWrapperClass = FEATURE_MAP_WRAPPER_CLASS_EDEFAULT;
747
748   /**
749    * The default value of the '{@link #isRuntimeCompatibility() <em>Runtime Compatibility</em>}' attribute.
750    * <!-- begin-user-doc -->
751    * <!-- end-user-doc -->
752    * @see #isRuntimeCompatibility()
753    * @generated
754    * @ordered
755    */

756   protected static final boolean RUNTIME_COMPATIBILITY_EDEFAULT = false;
757
758   /**
759    * The cached value of the '{@link #isRuntimeCompatibility() <em>Runtime Compatibility</em>}' attribute.
760    * <!-- begin-user-doc -->
761    * <!-- end-user-doc -->
762    * @see #isRuntimeCompatibility()
763    * @generated
764    * @ordered
765    */

766   protected boolean runtimeCompatibility = RUNTIME_COMPATIBILITY_EDEFAULT;
767
768   /**
769    * The default value of the '{@link #isRichClientPlatform() <em>Rich Client Platform</em>}' attribute.
770    * <!-- begin-user-doc -->
771    * <!-- end-user-doc -->
772    * @see #isRichClientPlatform()
773    * @generated
774    * @ordered
775    */

776   protected static final boolean RICH_CLIENT_PLATFORM_EDEFAULT = false;
777
778   /**
779    * The cached value of the '{@link #isRichClientPlatform() <em>Rich Client Platform</em>}' attribute.
780    * <!-- begin-user-doc -->
781    * <!-- end-user-doc -->
782    * @see #isRichClientPlatform()
783    * @generated
784    * @ordered
785    */

786   protected boolean richClientPlatform = RICH_CLIENT_PLATFORM_EDEFAULT;
787
788   /**
789    * The default value of the '{@link #isReflectiveDelegation() <em>Reflective Delegation</em>}' attribute.
790    * <!-- begin-user-doc -->
791    * <!-- end-user-doc -->
792    * @see #isReflectiveDelegation()
793    * @generated
794    * @ordered
795    */

796   protected static final boolean REFLECTIVE_DELEGATION_EDEFAULT = false;
797
798   /**
799    * The cached value of the '{@link #isReflectiveDelegation() <em>Reflective Delegation</em>}' attribute.
800    * <!-- begin-user-doc -->
801    * <!-- end-user-doc -->
802    * @see #isReflectiveDelegation()
803    * @generated
804    * @ordered
805    */

806   protected boolean reflectiveDelegation = REFLECTIVE_DELEGATION_EDEFAULT;
807
808   /**
809    * The default value of the '{@link #isCodeFormatting() <em>Code Formatting</em>}' attribute.
810    * <!-- begin-user-doc -->
811    * <!-- end-user-doc -->
812    * @see #isCodeFormatting()
813    * @generated
814    * @ordered
815    */

816   protected static final boolean CODE_FORMATTING_EDEFAULT = false;
817
818   /**
819    * The cached value of the '{@link #isCodeFormatting() <em>Code Formatting</em>}' attribute.
820    * <!-- begin-user-doc -->
821    * <!-- end-user-doc -->
822    * @see #isCodeFormatting()
823    * @generated
824    * @ordered
825    */

826   protected boolean codeFormatting = CODE_FORMATTING_EDEFAULT;
827
828   /**
829    * The default value of the '{@link #getTestsDirectory() <em>Tests Directory</em>}' attribute.
830    * <!-- begin-user-doc -->
831    * <!-- end-user-doc -->
832    * @see #getTestsDirectory()
833    * @generated
834    * @ordered
835    */

836   protected static final String JavaDoc TESTS_DIRECTORY_EDEFAULT = null;
837
838   /**
839    * The cached value of the '{@link #getTestsDirectory() <em>Tests Directory</em>}' attribute.
840    * <!-- begin-user-doc -->
841    * <!-- end-user-doc -->
842    * @see #getTestsDirectory()
843    * @generated
844    * @ordered
845    */

846   protected String JavaDoc testsDirectory = TESTS_DIRECTORY_EDEFAULT;
847
848   /**
849    * This is true if the Tests Directory attribute has been set.
850    * <!-- begin-user-doc -->
851    * <!-- end-user-doc -->
852    * @generated
853    * @ordered
854    */

855   protected boolean testsDirectoryESet = false;
856
857   /**
858    * The default value of the '{@link #getTestSuiteClass() <em>Test Suite Class</em>}' attribute.
859    * <!-- begin-user-doc -->
860    * <!-- end-user-doc -->
861    * @see #getTestSuiteClass()
862    * @generated
863    * @ordered
864    */

865   protected static final String JavaDoc TEST_SUITE_CLASS_EDEFAULT = null;
866
867   /**
868    * The cached value of the '{@link #getTestSuiteClass() <em>Test Suite Class</em>}' attribute.
869    * <!-- begin-user-doc -->
870    * <!-- end-user-doc -->
871    * @see #getTestSuiteClass()
872    * @generated
873    * @ordered
874    */

875   protected String JavaDoc testSuiteClass = TEST_SUITE_CLASS_EDEFAULT;
876
877   /**
878    * This is true if the Test Suite Class attribute has been set.
879    * <!-- begin-user-doc -->
880    * <!-- end-user-doc -->
881    * @generated
882    * @ordered
883    */

884   protected boolean testSuiteClassESet = false;
885
886   /**
887    * The default value of the '{@link #getBooleanFlagsField() <em>Boolean Flags Field</em>}' attribute.
888    * <!-- begin-user-doc -->
889    * <!-- end-user-doc -->
890    * @see #getBooleanFlagsField()
891    * @generated
892    * @ordered
893    */

894   protected static final String JavaDoc BOOLEAN_FLAGS_FIELD_EDEFAULT = null;
895
896   /**
897    * The cached value of the '{@link #getBooleanFlagsField() <em>Boolean Flags Field</em>}' attribute.
898    * <!-- begin-user-doc -->
899    * <!-- end-user-doc -->
900    * @see #getBooleanFlagsField()
901    * @generated
902    * @ordered
903    */

904   protected String JavaDoc booleanFlagsField = BOOLEAN_FLAGS_FIELD_EDEFAULT;
905
906   /**
907    * The default value of the '{@link #getBooleanFlagsReservedBits() <em>Boolean Flags Reserved Bits</em>}' attribute.
908    * <!-- begin-user-doc -->
909    * <!-- end-user-doc -->
910    * @see #getBooleanFlagsReservedBits()
911    * @generated
912    * @ordered
913    */

914   protected static final int BOOLEAN_FLAGS_RESERVED_BITS_EDEFAULT = -1;
915
916   /**
917    * The cached value of the '{@link #getBooleanFlagsReservedBits() <em>Boolean Flags Reserved Bits</em>}' attribute.
918    * <!-- begin-user-doc -->
919    * <!-- end-user-doc -->
920    * @see #getBooleanFlagsReservedBits()
921    * @generated
922    * @ordered
923    */

924   protected int booleanFlagsReservedBits = BOOLEAN_FLAGS_RESERVED_BITS_EDEFAULT;
925
926   /**
927    * The default value of the '{@link #getImporterID() <em>Importer ID</em>}' attribute.
928    * <!-- begin-user-doc -->
929    * <!-- end-user-doc -->
930    * @see #getImporterID()
931    * @generated
932    * @ordered
933    */

934   protected static final String JavaDoc IMPORTER_ID_EDEFAULT = null;
935
936   /**
937    * The cached value of the '{@link #getImporterID() <em>Importer ID</em>}' attribute.
938    * <!-- begin-user-doc -->
939    * <!-- end-user-doc -->
940    * @see #getImporterID()
941    * @generated
942    * @ordered
943    */

944   protected String JavaDoc importerID = IMPORTER_ID_EDEFAULT;
945
946   /**
947    * The default value of the '{@link #isBundleManifest() <em>Bundle Manifest</em>}' attribute.
948    * <!-- begin-user-doc -->
949    * <!-- end-user-doc -->
950    * @see #isBundleManifest()
951    * @generated
952    * @ordered
953    */

954   protected static final boolean BUNDLE_MANIFEST_EDEFAULT = true;
955
956   /**
957    * The cached value of the '{@link #isBundleManifest() <em>Bundle Manifest</em>}' attribute.
958    * <!-- begin-user-doc -->
959    * <!-- end-user-doc -->
960    * @see #isBundleManifest()
961    * @generated
962    * @ordered
963    */

964   protected boolean bundleManifest = BUNDLE_MANIFEST_EDEFAULT;
965
966   /**
967    * The cached value of the '{@link #getGenPackages() <em>Gen Packages</em>}' containment reference list.
968    * <!-- begin-user-doc -->
969    * <!-- end-user-doc -->
970    * @see #getGenPackages()
971    * @generated
972    * @ordered
973    */

974   protected EList genPackages = null;
975
976   protected EList staticGenPackages = null;
977
978   /**
979    * The cached value of the '{@link #getUsedGenPackages() <em>Used Gen Packages</em>}' reference list.
980    * <!-- begin-user-doc -->
981    * <!-- end-user-doc -->
982    * @see #getUsedGenPackages()
983    * @generated
984    * @ordered
985    */

986   protected EList usedGenPackages = null;
987
988   /**
989    * <!-- begin-user-doc -->
990    * <!-- end-user-doc -->
991    * @generated modifiable
992    */

993   protected GenModelImpl()
994   {
995     super();
996   }
997
998   /**
999    * <!-- begin-user-doc -->
1000   * <!-- end-user-doc -->
1001   * @generated
1002   */

1003  protected EClass eStaticClass()
1004  {
1005    return GenModelPackage.eINSTANCE.getGenModel();
1006  }
1007
1008  /**
1009   * <!-- begin-user-doc -->
1010   * <!-- end-user-doc -->
1011   * @generated
1012   */

1013  public String JavaDoc getCopyrightText()
1014  {
1015    return copyrightText;
1016  }
1017
1018  /**
1019   * <!-- begin-user-doc -->
1020   * <!-- end-user-doc -->
1021   * @generated
1022   */

1023  public void setCopyrightText(String JavaDoc newCopyrightText)
1024  {
1025    String JavaDoc oldCopyrightText = copyrightText;
1026    copyrightText = newCopyrightText;
1027    if (eNotificationRequired())
1028      eNotify(new ENotificationImpl(this, Notification.SET, GenModelPackage.GEN_MODEL__COPYRIGHT_TEXT, oldCopyrightText, copyrightText));
1029  }
1030
1031  protected String JavaDoc getSourceFragmentPath()
1032  {
1033    return "src";
1034  }
1035
1036  
1037  /**
1038   * <!-- begin-user-doc -->
1039   * <!-- end-user-doc -->
1040   * @generated
1041   */

1042  public String JavaDoc getModelDirectory()
1043  {
1044    return modelDirectory;
1045  }
1046
1047  /**
1048   * <!-- begin-user-doc -->
1049   * <!-- end-user-doc -->
1050   * @generated
1051   */

1052  public String JavaDoc getModelDirectoryGen()
1053  {
1054    return modelDirectory;
1055  }
1056
1057  /**
1058   * <!-- begin-user-doc -->
1059   * <!-- end-user-doc -->
1060   * @generated
1061   */

1062  public void setModelDirectory(String JavaDoc newModelDirectory)
1063  {
1064    String JavaDoc oldModelDirectory = modelDirectory;
1065    modelDirectory = newModelDirectory;
1066    if (eNotificationRequired())
1067      eNotify(new ENotificationImpl(this, Notification.SET, GenModelPackage.GEN_MODEL__MODEL_DIRECTORY, oldModelDirectory, modelDirectory));
1068  }
1069
1070  /**
1071   * <!-- begin-user-doc -->
1072   * <!-- end-user-doc -->
1073   * @generated
1074   */

1075  public boolean isCreationCommands()
1076  {
1077    return creationCommands;
1078  }
1079
1080  /**
1081   * <!-- begin-user-doc -->
1082   * <!-- end-user-doc -->
1083   * @generated
1084   */

1085  public void setCreationCommands(boolean newCreationCommands)
1086  {
1087    boolean oldCreationCommands = creationCommands;
1088    creationCommands = newCreationCommands;
1089    if (eNotificationRequired())
1090      eNotify(new ENotificationImpl(this, Notification.SET, GenModelPackage.GEN_MODEL__CREATION_COMMANDS, oldCreationCommands, creationCommands));
1091  }
1092
1093  /**
1094   * <!-- begin-user-doc -->
1095   * <!-- end-user-doc -->
1096   * @generated
1097   */

1098  public boolean isCreationIcons()
1099  {
1100    return creationIcons;
1101  }
1102
1103  /**
1104   * <!-- begin-user-doc -->
1105   * <!-- end-user-doc -->
1106   * @generated
1107   */

1108  public void setCreationIcons(boolean newCreationIcons)
1109  {
1110    boolean oldCreationIcons = creationIcons;
1111    creationIcons = newCreationIcons;
1112    if (eNotificationRequired())
1113      eNotify(new ENotificationImpl(this, Notification.SET, GenModelPackage.GEN_MODEL__CREATION_ICONS, oldCreationIcons, creationIcons));
1114  }
1115
1116  protected ImportManager importManager;
1117  protected StringBuffer JavaDoc importStringBuffer;
1118  protected int importInsertionPoint;
1119  protected boolean canGenerate;
1120
1121  public void markImportLocation(StringBuffer JavaDoc stringBuffer, GenPackage genPackage)
1122  {
1123    markImportLocation(stringBuffer);
1124    importManager.addJavaLangImports(genPackage.getJavaLangConflicts());
1125  }
1126
1127  public void markImportLocation(StringBuffer JavaDoc stringBuffer)
1128  {
1129    importStringBuffer = stringBuffer;
1130    importInsertionPoint = stringBuffer.length();
1131    importManager.addCompilationUnitImports(stringBuffer.toString());
1132  }
1133
1134  public void emitSortedImports()
1135  {
1136    importStringBuffer.insert(importInsertionPoint, importManager.computeSortedImports());
1137  }
1138
1139  public String JavaDoc getImportedName(String JavaDoc qualifiedName)
1140  {
1141    int index = qualifiedName.indexOf("$");
1142    importManager.addImport(index == -1 ? qualifiedName : qualifiedName.substring(0, index));
1143    return importManager.getImportedName(qualifiedName);
1144  }
1145
1146  public void addImport(String JavaDoc qualifiedName)
1147  {
1148    importManager.addImport(qualifiedName);
1149  }
1150
1151  public void addPseudoImport(String JavaDoc qualifiedName)
1152  {
1153    importManager.addPseudoImport(qualifiedName);
1154  }
1155
1156  protected ImportManager getImportManager()
1157  {
1158    return importManager;
1159  }
1160
1161  protected void setImportManager(ImportManager importManager)
1162  {
1163    this.importManager = importManager;
1164
1165    for (Iterator JavaDoc iter = getUsedGenPackages().iterator(); iter.hasNext(); )
1166    {
1167      GenBaseImpl genPackage = (GenBaseImpl)iter.next();
1168      genPackage.setImportManager(importManager); //FB TBD need to rethink the GenModel role
1169
}
1170
1171    for (Iterator JavaDoc iter = getStaticGenPackages().iterator(); iter.hasNext(); )
1172    {
1173      GenBaseImpl genPackage = (GenBaseImpl)iter.next();
1174      genPackage.setImportManager(importManager); //FB TBD need to rethink the GenModel role
1175
}
1176  }
1177
1178  public String JavaDoc getDriverNumber()
1179  {
1180    //TBD
1181
// EATM return "jet0000";
1182
return null;
1183  }
1184
1185  public String JavaDoc getDate()
1186  {
1187    //TBD
1188
// EATM return "mm-dd-yyyy";
1189
return null;
1190  }
1191
1192  public String JavaDoc getNonNLS()
1193  {
1194    return isNonNLSMarkers() ? " //$NON-NLS-1$" : "";
1195  }
1196
1197  public String JavaDoc getNonNLS(int i)
1198  {
1199    if (isNonNLSMarkers())
1200    {
1201      StringBuffer JavaDoc result = new StringBuffer JavaDoc(15);
1202      result.append(" //$NON-NLS-");
1203      result.append(i);
1204      result.append('$');
1205      return result.toString();
1206    }
1207    return "";
1208  }
1209
1210  public String JavaDoc getNonNLS(String JavaDoc s)
1211  {
1212    return getNonNLS(s, 1);
1213  }
1214
1215  public String JavaDoc getNonNLS(String JavaDoc s, int i)
1216  {
1217    if (s == null) return "";
1218
1219    StringBuffer JavaDoc result = new StringBuffer JavaDoc(15);
1220    boolean openQuote = true;
1221    int j = s.indexOf('\"');
1222
1223    while (j != -1)
1224    {
1225      if (openQuote) result.append(getNonNLS(i++));
1226      openQuote = !openQuote;
1227      j = s.indexOf('\"', j + 1);
1228    }
1229    return result.toString();
1230  }
1231
1232  public void initialize(Collection JavaDoc ePackages)
1233  {
1234    LOOP:
1235    for (Iterator JavaDoc iter = ePackages.iterator(); iter.hasNext(); )
1236    {
1237      EPackage ePackage = (EPackage)iter.next();
1238
1239      for (Iterator JavaDoc j = getGenPackages().iterator(); j.hasNext(); )
1240      {
1241        GenPackage genPackage = (GenPackage)j.next();
1242        if (genPackage.getEcorePackage() == ePackage)
1243        {
1244          genPackage.initialize(ePackage);
1245          continue LOOP;
1246        }
1247      }
1248
1249      GenPackage genPackage = createGenPackage();
1250      getGenPackages().add(genPackage);
1251      genPackage.initialize(ePackage);
1252    }
1253  }
1254
1255  protected String JavaDoc jControlModelName = "emf-merge.xml";
1256
1257  protected String JavaDoc interfaceTemplateName = "model/Interface.javajet";
1258  protected String JavaDoc classTemplateName = "model/Class.javajet";
1259  protected String JavaDoc enumClassTemplateName = "model/EnumClass.javajet";
1260  protected String JavaDoc packageInterfaceTemplateName = "model/PackageInterface.javajet";
1261  protected String JavaDoc packageClassTemplateName = "model/PackageClass.javajet";
1262  protected String JavaDoc factoryInterfaceTemplateName = "model/FactoryInterface.javajet";
1263  protected String JavaDoc factoryClassTemplateName = "model/FactoryClass.javajet";
1264  protected String JavaDoc adapterFactoryClassTemplateName = "model/AdapterFactoryClass.javajet";
1265  protected String JavaDoc switchClassTemplateName = "model/SwitchClass.javajet";
1266  protected String JavaDoc validatorSwitchClassTemplateName = "model/ValidatorClass.javajet";
1267  protected String JavaDoc pluginXMLTemplateName = "model/plugin.xmljet";
1268  protected String JavaDoc manifestMFTemplateName = "model/manifest.mfjet";
1269  protected String JavaDoc pluginPropertiesTemplateName = "model/plugin.propertiesjet";
1270  protected String JavaDoc buildPropertiesTemplateName = "model/build.propertiesjet";
1271  protected String JavaDoc modelPluginTemplateName = "model/Plugin.javajet";
1272  protected String JavaDoc resourceTemplateName = "model/ResourceClass.javajet";
1273  protected String JavaDoc resourceFactoryTemplateName = "model/ResourceFactoryClass.javajet";
1274
1275  protected String JavaDoc [] templatePath = null;
1276
1277  protected JControlModel jControlModel = null;
1278
1279  protected JETEmitter interfaceEmitter = null;
1280  protected JETEmitter classEmitter = null;
1281  protected JETEmitter enumClassEmitter = null;
1282  protected JETEmitter packageInterfaceEmitter = null;
1283  protected JETEmitter packageClassEmitter = null;
1284  protected JETEmitter factoryInterfaceEmitter = null;
1285  protected JETEmitter factoryClassEmitter = null;
1286  protected JETEmitter adapterFactoryClassEmitter = null;
1287  protected JETEmitter switchClassEmitter = null;
1288  protected JETEmitter validatorSwitchClassEmitter = null;
1289  protected JETEmitter pluginXMLEmitter = null;
1290  protected JETEmitter manifestMFEmitter = null;
1291  protected JETEmitter pluginPropertiesEmitter = null;
1292  protected JETEmitter buildPropertiesEmitter = null;
1293  protected JETEmitter modelPluginClassEmitter = null;
1294  protected JETEmitter resourceClassEmitter = null;
1295  protected JETEmitter resourceFactoryClassEmitter = null;
1296
1297  protected String JavaDoc [] getTemplatePath()
1298  {
1299    if (templatePath == null)
1300    {
1301      templatePath = new String JavaDoc[2];
1302    }
1303    String JavaDoc theTemplateDirectory = getTemplateDirectory();
1304    templatePath[0] =
1305      !isDynamicTemplates() ?
1306        null :
1307        theTemplateDirectory != null && theTemplateDirectory.indexOf(":") == -1 ?
1308          URI.createPlatformResourceURI(theTemplateDirectory).toString() :
1309          theTemplateDirectory;
1310    templatePath[1] = CodeGenEcorePlugin.INSTANCE.getBaseURL().toString() + "templates";
1311    return templatePath;
1312  }
1313
1314  public JControlModel getJControlModel()
1315  {
1316    if (jControlModel == null)
1317    {
1318      jControlModel = new JControlModel(JETCompiler.find(getTemplatePath(), jControlModelName));
1319    }
1320    return jControlModel;
1321  }
1322
1323  public static final Class JavaDoc [] OBJECT_ARGUMENT = new Class JavaDoc [ ] { Object JavaDoc.class };
1324  public void setMethod(JETEmitter jetEmitter, String JavaDoc className)
1325  {
1326    if (!isDynamicTemplates())
1327    {
1328      try
1329      {
1330        Class JavaDoc emitterClass = getClass().getClassLoader().loadClass(className);
1331        Method JavaDoc emitterMethod = emitterClass.getDeclaredMethod("generate", OBJECT_ARGUMENT);
1332        jetEmitter.setMethod(emitterMethod);
1333      }
1334      catch (Exception JavaDoc exception)
1335      {
1336        // It's okay for there not be a precompiled template, so fail quietly.
1337
// exception.printStackTrace();
1338
}
1339    }
1340  }
1341
1342  protected JETEmitter createJETEmitter(String JavaDoc relativeTemplateURI)
1343  {
1344    JETEmitter jetEmitter =
1345      new JETEmitter(getTemplatePath(), relativeTemplateURI, getClass().getClassLoader())
1346      {
1347        public void initialize(IProgressMonitor progressMonitor) throws JETException
1348        {
1349          if (getClasspathEntries().isEmpty())
1350          {
1351            addClasspathEntries(this);
1352          }
1353          super.initialize(progressMonitor);
1354        }
1355      };
1356    return jetEmitter;
1357  }
1358
1359  protected void addClasspathEntries(JETEmitter jetEmitter) throws JETException
1360  {
1361    jetEmitter.addVariable("EMF_CODEGEN", "org.eclipse.emf.codegen");
1362    jetEmitter.addVariable("EMF_CODEGEN_ECORE", "org.eclipse.emf.codegen.ecore");
1363    jetEmitter.addVariable("EMF_COMMON", "org.eclipse.emf.common");
1364    jetEmitter.addVariable("EMF_ECORE", "org.eclipse.emf.ecore");
1365  }
1366
1367  public JETEmitter getInterfaceEmitter()
1368  {
1369    if (interfaceEmitter == null)
1370    {
1371      interfaceEmitter = createJETEmitter(interfaceTemplateName);
1372      setMethod(interfaceEmitter, "org.eclipse.emf.codegen.ecore.templates.model.Interface");
1373    }
1374    return interfaceEmitter;
1375  }
1376
1377  public JETEmitter getClassEmitter()
1378  {
1379    if (classEmitter == null)
1380    {
1381      classEmitter = createJETEmitter(classTemplateName);
1382      setMethod(classEmitter, "org.eclipse.emf.codegen.ecore.templates.model.Class");
1383    }
1384    return classEmitter;
1385  }
1386
1387  public JETEmitter getEnumClassEmitter()
1388  {
1389    if (enumClassEmitter == null)
1390    {
1391      enumClassEmitter = createJETEmitter(enumClassTemplateName);
1392      setMethod(enumClassEmitter, "org.eclipse.emf.codegen.ecore.templates.model.EnumClass");
1393    }
1394    return enumClassEmitter;
1395  }
1396
1397  public JETEmitter getFactoryInterfaceEmitter()
1398  {
1399    if (factoryInterfaceEmitter == null)
1400    {
1401      factoryInterfaceEmitter = createJETEmitter(factoryInterfaceTemplateName);
1402      setMethod(factoryInterfaceEmitter, "org.eclipse.emf.codegen.ecore.templates.model.FactoryInterface");
1403    }
1404    return factoryInterfaceEmitter;
1405  }
1406
1407  public JETEmitter getFactoryClassEmitter()
1408  {
1409    if (factoryClassEmitter == null)
1410    {
1411      factoryClassEmitter = createJETEmitter(factoryClassTemplateName);
1412      setMethod(factoryClassEmitter, "org.eclipse.emf.codegen.ecore.templates.model.FactoryClass");
1413    }
1414    return factoryClassEmitter;
1415  }
1416
1417  public JETEmitter getPackageInterfaceEmitter()
1418  {
1419    if (packageInterfaceEmitter == null)
1420    {
1421      packageInterfaceEmitter = createJETEmitter(packageInterfaceTemplateName);
1422      setMethod(packageInterfaceEmitter, "org.eclipse.emf.codegen.ecore.templates.model.PackageInterface");
1423    }
1424    return packageInterfaceEmitter;
1425  }
1426
1427  public JETEmitter getPackageClassEmitter()
1428  {
1429    if (packageClassEmitter == null)
1430    {
1431      packageClassEmitter = createJETEmitter(packageClassTemplateName);
1432      setMethod(packageClassEmitter, "org.eclipse.emf.codegen.ecore.templates.model.PackageClass");
1433    }
1434    return packageClassEmitter;
1435  }
1436
1437  public JETEmitter getAdapterFactoryClassEmitter()
1438  {
1439    if (adapterFactoryClassEmitter == null)
1440    {
1441      adapterFactoryClassEmitter = createJETEmitter(adapterFactoryClassTemplateName);
1442      setMethod(adapterFactoryClassEmitter, "org.eclipse.emf.codegen.ecore.templates.model.AdapterFactoryClass");
1443    }
1444    return adapterFactoryClassEmitter;
1445  }
1446
1447  public JETEmitter getSwitchClassEmitter()
1448  {
1449    if (switchClassEmitter == null)
1450    {
1451      switchClassEmitter = createJETEmitter(switchClassTemplateName);
1452      setMethod(switchClassEmitter, "org.eclipse.emf.codegen.ecore.templates.model.SwitchClass");
1453    }
1454    return switchClassEmitter;
1455  }
1456
1457  public JETEmitter getValidatorClassEmitter()
1458  {
1459    if (validatorSwitchClassEmitter == null)
1460    {
1461      validatorSwitchClassEmitter = createJETEmitter(validatorSwitchClassTemplateName);
1462      setMethod(validatorSwitchClassEmitter, "org.eclipse.emf.codegen.ecore.templates.model.ValidatorClass");
1463    }
1464    return validatorSwitchClassEmitter;
1465  }
1466
1467  public JETEmitter getPluginXMLEmitter()
1468  {
1469    if (pluginXMLEmitter == null)
1470    {
1471      pluginXMLEmitter = createJETEmitter(pluginXMLTemplateName);
1472      setMethod(pluginXMLEmitter, "org.eclipse.emf.codegen.ecore.templates.model.PluginXML");
1473    }
1474    return pluginXMLEmitter;
1475  }
1476
1477  public JETEmitter getManifestMFEmitter()
1478  {
1479    if (manifestMFEmitter == null)
1480    {
1481      manifestMFEmitter = createJETEmitter(manifestMFTemplateName);
1482      setMethod(manifestMFEmitter, "org.eclipse.emf.codegen.ecore.templates.model.ManifestMF");
1483    }
1484    return manifestMFEmitter;
1485  }
1486
1487  public JETEmitter getPluginPropertiesEmitter()
1488  {
1489    if (pluginPropertiesEmitter == null)
1490    {
1491      pluginPropertiesEmitter = createJETEmitter(pluginPropertiesTemplateName);
1492      setMethod(pluginPropertiesEmitter, "org.eclipse.emf.codegen.ecore.templates.model.PluginProperties");
1493    }
1494    return pluginPropertiesEmitter;
1495  }
1496
1497  public JETEmitter getBuildPropertiesEmitter()
1498  {
1499    if (buildPropertiesEmitter == null)
1500    {
1501      buildPropertiesEmitter = createJETEmitter(buildPropertiesTemplateName);
1502      setMethod(buildPropertiesEmitter, "org.eclipse.emf.codegen.ecore.templates.model.BuildProperties");
1503    }
1504    return buildPropertiesEmitter;
1505  }
1506
1507  public JETEmitter getModelPluginClassEmitter()
1508  {
1509    if (modelPluginClassEmitter == null)
1510    {
1511      modelPluginClassEmitter = createJETEmitter(modelPluginTemplateName);
1512      setMethod(modelPluginClassEmitter, "org.eclipse.emf.codegen.ecore.templates.model.Plugin");
1513    }
1514    return modelPluginClassEmitter;
1515  }
1516
1517  public JETEmitter getResourceClassEmitter()
1518  {
1519    if (resourceClassEmitter == null)
1520    {
1521      resourceClassEmitter = createJETEmitter(resourceTemplateName);
1522      setMethod(resourceClassEmitter, "org.eclipse.emf.codegen.ecore.templates.model.ResourceClass");
1523    }
1524    return resourceClassEmitter;
1525  }
1526
1527  public JETEmitter getResourceFactoryClassEmitter()
1528  {
1529    if (resourceFactoryClassEmitter == null)
1530    {
1531      resourceFactoryClassEmitter = createJETEmitter(resourceFactoryTemplateName);
1532      setMethod(resourceFactoryClassEmitter, "org.eclipse.emf.codegen.ecore.templates.model.ResourceFactoryClass");
1533    }
1534    return resourceFactoryClassEmitter;
1535  }
1536
1537  protected boolean hasModelSupport()
1538  {
1539    return !isBlank(getModelDirectory());
1540    // Don't care about plugin class; we can generate a model without one.
1541
}
1542
1543  public boolean canGenerate()
1544  {
1545    return canGenerate && hasModelSupport();
1546  }
1547
1548  public void setCanGenerate(boolean canGenerate)
1549  {
1550    this.canGenerate = canGenerate;
1551  }
1552
1553  public IStatus validate()
1554  {
1555    MultiStatus status =
1556      new MultiStatus
1557        (CodeGenEcorePlugin.INSTANCE.getSymbolicName(),
1558         0,
1559         CodeGenEcorePlugin.INSTANCE.getString("_UI_ProblemsEncounteredInTheModel_message"),
1560         null);
1561
1562    List JavaDoc all = new ArrayList JavaDoc(getGenPackages());
1563
1564    all.addAll(getUsedGenPackages());
1565    for (Iterator JavaDoc i = new ArrayList JavaDoc(all).iterator(); i.hasNext(); )
1566    {
1567      GenPackage genPackage = (GenPackage)i.next();
1568      EObject root = EcoreUtil.getRootContainer(genPackage.getEcorePackage());
1569      if (!all.contains(root))
1570      {
1571        all.add(root);
1572      }
1573    }
1574
1575    Map JavaDoc map = EcoreUtil.UnresolvedProxyCrossReferencer.find(all);
1576    if (!map.isEmpty())
1577    {
1578      for (Iterator JavaDoc i = map.entrySet().iterator(); i.hasNext(); )
1579      {
1580        Map.Entry JavaDoc entry = (Map.Entry JavaDoc)i.next();
1581        EObject unresolvedProxy = (EObject)entry.getKey();
1582
1583        MultiStatus nestedStatus =
1584          new MultiStatus
1585            (CodeGenEcorePlugin.INSTANCE.getSymbolicName(),
1586             0,
1587             CodeGenEcorePlugin.INSTANCE.getString
1588               ("_UI_UnableToResolveProxy_message", new Object JavaDoc [] { EcoreUtil.getURI(unresolvedProxy) }),
1589             null);
1590
1591        for (Iterator JavaDoc j = ((List JavaDoc)entry.getValue()).iterator(); j.hasNext(); )
1592        {
1593          EStructuralFeature.Setting setting = (EStructuralFeature.Setting)j.next();
1594          nestedStatus.add
1595            (new Status
1596              (IStatus.ERROR,
1597                  CodeGenEcorePlugin.INSTANCE.getSymbolicName(),
1598               0,
1599               CodeGenEcorePlugin.INSTANCE.getString
1600                 ("_UI_ItsUseIsBy_message", new Object JavaDoc [] { EcoreUtil.getURI(setting.getEObject()) }),
1601               null));
1602        }
1603
1604        status.add(nestedStatus);
1605      }
1606    }
1607    else
1608    {
1609      List JavaDoc referencedEPackages = new UniqueEList();
1610      for (Iterator JavaDoc i = all.iterator(); i.hasNext(); )
1611      {
1612        Object JavaDoc object = i.next();
1613        if (object instanceof EPackage)
1614        {
1615          EPackage ePackage = (EPackage)object;
1616          for (Iterator JavaDoc j = ePackage.eAllContents(); j.hasNext();)
1617          {
1618            EObject eObject = (EObject)j.next();
1619            for (Iterator JavaDoc k = eObject.eCrossReferences().iterator(); k.hasNext(); )
1620            {
1621              Object JavaDoc o = k.next();
1622              if (o instanceof EClassifier)
1623              {
1624                EClassifier eClassifier = (EClassifier)o;
1625                referencedEPackages.add(eClassifier.getEPackage());
1626              }
1627            }
1628          }
1629        }
1630      }
1631    
1632      for (Iterator JavaDoc i = referencedEPackages.iterator(); i.hasNext(); )
1633      {
1634        EPackage ePackage = (EPackage)i.next();
1635        GenPackage genPackage = findGenPackage(ePackage);
1636        if (genPackage == null)
1637        {
1638          status.add
1639            (new Status
1640              (IStatus.ERROR,
1641                  CodeGenEcorePlugin.INSTANCE.getSymbolicName(),
1642               0,
1643               CodeGenEcorePlugin.INSTANCE.getString("_UI_ThePackageIsNeeded_message", new Object JavaDoc [] { EcoreUtil.getURI(ePackage) }),
1644               null));
1645        }
1646        else if (genPackage.getEcorePackage() != ePackage)
1647        {
1648          status.add
1649            (new Status
1650              (IStatus.ERROR,
1651                  CodeGenEcorePlugin.INSTANCE.getSymbolicName(),
1652               0,
1653               CodeGenEcorePlugin.INSTANCE.getString
1654                 ("_UI_ThePackageHasTheSameNamespaceURI",
1655                  new Object JavaDoc [] { EcoreUtil.getURI(ePackage), ePackage.getNsURI(), EcoreUtil.getURI(genPackage.getEcorePackage()) }),
1656               null));
1657        }
1658      }
1659    }
1660
1661    return status;
1662  }
1663
1664  protected ExtendedMetaData extendedMetaData;
1665  public ExtendedMetaData getExtendedMetaData()
1666  {
1667    if (extendedMetaData == null)
1668    {
1669      extendedMetaData =
1670        eResource() == null || eResource().getResourceSet() == null ?
1671          ExtendedMetaData.INSTANCE :
1672          new BasicExtendedMetaData(eResource().getResourceSet().getPackageRegistry());
1673      populateExtendedMetaData(getGenPackages());
1674      populateExtendedMetaData(getStaticGenPackages());
1675      populateExtendedMetaData(getUsedGenPackages());
1676    }
1677    return extendedMetaData;
1678  }
1679
1680  protected void populateExtendedMetaData(List JavaDoc genPackages)
1681  {
1682    for (Iterator JavaDoc i = genPackages.iterator(); i.hasNext(); )
1683    {
1684      GenPackage genPackage = (GenPackage)i.next();
1685      EPackage ePackage = genPackage.getEcorePackage();
1686      if (ePackage != null) // genPackage can be a broken proxy
1687
{
1688        if (!EcorePackage.eNS_URI.equals(ePackage.getNsURI()) && ! GenModelPackage.eNS_URI.equals(ePackage.getNsURI()))
1689        {
1690          extendedMetaData.putPackage(ePackage.getNsURI(), ePackage);
1691        }
1692        populateExtendedMetaData(genPackage.getSubGenPackages());
1693      }
1694    }
1695  }
1696
1697  public boolean hasPluginSupport()
1698  {
1699    return !isBlank(getModelPluginID());
1700  }
1701
1702  public void generate(IProgressMonitor progressMonitor)
1703  {
1704    try
1705    {
1706      if (!canGenerate()) return;
1707
1708      getStaticGenPackages();
1709
1710      progressMonitor.beginTask("", getGenPackages().size() + 3);
1711      progressMonitor.subTask(CodeGenEcorePlugin.INSTANCE.getString("_UI_GeneratingPackages_message"));
1712
1713      // Force the project to be setup properly.
1714
//
1715
if (isUpdateClasspath())
1716      {
1717        findOrCreateContainer
1718          (new SubProgressMonitor(progressMonitor, 1),
1719           Generator.EMF_MODEL_PROJECT_STYLE,
1720           getEffectiveModelPluginVariables(),
1721           new Path(getModelDirectory()), true);
1722      }
1723
1724      for (Iterator JavaDoc iter = getGenPackages().iterator(); iter.hasNext(); )
1725      {
1726        GenPackage genPackage = (GenPackage)iter.next();
1727        progressMonitor.subTask
1728          (CodeGenEcorePlugin.INSTANCE.getString
1729             ("_UI_GeneratingJavaPackage_message", new Object JavaDoc [] { genPackage.getInterfacePackageName() }));
1730        genPackage.generate(new SubProgressMonitor(progressMonitor, 1));
1731      }
1732
1733      if (hasModelPluginClass())
1734      {
1735        progressMonitor.subTask
1736          (CodeGenEcorePlugin.INSTANCE.getString
1737             ("_UI_GeneratingJavaClass_message", new Object JavaDoc [] { getQualifiedModelPluginClassName() }));
1738        generate
1739          (new SubProgressMonitor(progressMonitor, 1),
1740           Generator.EMF_MODEL_PROJECT_STYLE,
1741           getEffectiveModelPluginVariables(),
1742           getModelDirectory(),
1743           getModelPluginPackageName(),
1744           getModelPluginClassName(),
1745           getModelPluginClassEmitter());
1746      }
1747
1748      if (hasPluginSupport())
1749      {
1750        if (!sameModelEditProject() && !sameModelEditorProject())
1751        {
1752          if (isBundleManifest())
1753          {
1754            progressMonitor.subTask(CodeGenEcorePlugin.INSTANCE.getString("_UI_GeneratingModelManifestMF_message"));
1755            generate
1756              (new SubProgressMonitor(progressMonitor, 1),
1757               Generator.EMF_MODEL_PROJECT_STYLE,
1758               getEffectiveModelPluginVariables(),
1759               getModelProjectDirectory() + "/META-INF/MANIFEST.MF",
1760               getManifestMFEmitter());
1761          }
1762          
1763          progressMonitor.subTask(CodeGenEcorePlugin.INSTANCE.getString("_UI_GeneratingModelPluginXML_message"));
1764          generate
1765            (new SubProgressMonitor(progressMonitor, 1),
1766             Generator.EMF_MODEL_PROJECT_STYLE,
1767             getEffectiveModelPluginVariables(),
1768             getModelProjectDirectory() + "/plugin.xml",
1769             getPluginXMLEmitter());
1770        }
1771  
1772        progressMonitor.subTask(CodeGenEcorePlugin.INSTANCE.getString("_UI_GeneratingModelPluginProperties_message"));
1773        generate
1774          (new SubProgressMonitor(progressMonitor, 1),
1775           Generator.EMF_MODEL_PROJECT_STYLE,
1776           getEffectiveModelPluginVariables(),
1777           getModelProjectDirectory() + "/plugin.properties",
1778           getPluginPropertiesEmitter());
1779        
1780        progressMonitor.subTask(CodeGenEcorePlugin.INSTANCE.getString("_UI_GeneratingModelBuildProperties_message"));
1781        generate
1782          (new SubProgressMonitor(progressMonitor, 1),
1783           Generator.EMF_MODEL_PROJECT_STYLE,
1784           getEffectiveModelPluginVariables(),
1785           getModelProjectDirectory() + "/build.properties",
1786           getBuildPropertiesEmitter());
1787      }
1788    }
1789    finally
1790    {
1791      progressMonitor.done();
1792    }
1793  }
1794
1795  public boolean hasEditSupport()
1796  {
1797    return
1798      hasPluginSupport() &&
1799      !isBlank(getEditPluginClassToUse()) &&
1800      !isBlank(getEditDirectory());
1801  }
1802
1803  public boolean canGenerateEdit()
1804  {
1805    return canGenerate && hasEditSupport();
1806  }
1807
1808  public void generateEdit(IProgressMonitor progressMonitor)
1809  {
1810    try
1811    {
1812      if (!canGenerateEdit()) return;
1813
1814      getStaticGenPackages();
1815
1816      progressMonitor.beginTask("", getGenPackages().size() + 1);
1817
1818      // Force the project to be setup properly.
1819
//
1820
if (isUpdateClasspath())
1821      {
1822        findOrCreateContainer
1823          (new SubProgressMonitor(progressMonitor, 1),
1824           Generator.EMF_EDIT_PROJECT_STYLE,
1825           getEffectiveModelPluginVariables(),
1826           new Path(getEditDirectory()),
1827           true);
1828      }
1829
1830      progressMonitor.subTask(CodeGenEcorePlugin.INSTANCE.getString("_UI_GeneratingEditPackages_message"));
1831      for (Iterator JavaDoc iter = getGenPackages().iterator(); iter.hasNext(); )
1832      {
1833        GenPackage genPackage = (GenPackage)iter.next();
1834        progressMonitor.subTask
1835          (CodeGenEcorePlugin.INSTANCE.getString
1836             ("_UI_GeneratingJavaPackage_message", new Object JavaDoc [] { genPackage.getInterfacePackageName() }));
1837        genPackage.generateEdit(new SubProgressMonitor(progressMonitor, 1));
1838      }
1839
1840      if (!sameEditEditorProject())
1841      {
1842        progressMonitor.subTask
1843          (CodeGenEcorePlugin.INSTANCE.getString
1844             ("_UI_GeneratingJavaClass_message", new Object JavaDoc [] { getQualifiedEditPluginClassName() }));
1845        generate
1846          (new SubProgressMonitor(progressMonitor, 1),
1847           Generator.EMF_EDIT_PROJECT_STYLE,
1848           getEffectiveModelPluginVariables(),
1849           getEditPluginDirectory(),
1850           getEditPluginPackageName(),
1851           getEditPluginClassName(),
1852           getEditPluginClassEmitter());
1853
1854        if (isBundleManifest())
1855        {
1856          progressMonitor.subTask(CodeGenEcorePlugin.INSTANCE.getString("_UI_GeneratingEditManifestMF_message"));
1857          generate
1858            (new SubProgressMonitor(progressMonitor, 1),
1859             Generator.EMF_EDIT_PROJECT_STYLE,
1860             getEffectiveModelPluginVariables(),
1861             getEditProjectDirectory() + "/META-INF/MANIFEST.MF",
1862             getEditManifestMFEmitter());
1863        }
1864        
1865        progressMonitor.subTask(CodeGenEcorePlugin.INSTANCE.getString("_UI_GeneratingEditPluginXML_message"));
1866        generate
1867          (new SubProgressMonitor(progressMonitor, 1),
1868           Generator.EMF_EDIT_PROJECT_STYLE,
1869           getEffectiveModelPluginVariables(),
1870           getEditProjectDirectory() + "/plugin.xml",
1871           getEditPluginXMLEmitter());
1872      }
1873
1874      progressMonitor.subTask(CodeGenEcorePlugin.INSTANCE.getString("_UI_GeneratingEditPluginProperties_message"));
1875      generate
1876        (new SubProgressMonitor(progressMonitor, 1),
1877         Generator.EMF_EDIT_PROJECT_STYLE,
1878         getEffectiveModelPluginVariables(),
1879         getEditProjectDirectory() + "/plugin.properties",
1880         getEditPluginPropertiesEmitter());
1881
1882      progressMonitor.subTask(CodeGenEcorePlugin.INSTANCE.getString("_UI_GeneratingEditBuildProperties_message"));
1883      generate
1884        (new SubProgressMonitor(progressMonitor, 1),
1885         Generator.EMF_EDIT_PROJECT_STYLE,
1886         getEffectiveModelPluginVariables(),
1887         getEditProjectDirectory() + "/build.properties",
1888         getEditBuildPropertiesEmitter());
1889    }
1890    finally
1891    {
1892      progressMonitor.done();
1893    }
1894  }
1895
1896  public boolean hasEditorSupport()
1897  {
1898    return
1899      hasPluginSupport() &&
1900      !isBlank(getEditorPluginClassToUse()) &&
1901      !isBlank(getEditorDirectory());
1902  }
1903
1904  public boolean canGenerateEditor()
1905  {
1906    return canGenerate && hasEditorSupport();
1907  }
1908
1909  public void generateEditor(IProgressMonitor progressMonitor)
1910  {
1911    try
1912    {
1913      if (!canGenerateEditor()) return;
1914
1915      getStaticGenPackages();
1916
1917      progressMonitor.beginTask("", getGenPackages().size() + 1);
1918
1919      // Force the project to be setup properly.
1920
//
1921
if (isUpdateClasspath())
1922      {
1923        findOrCreateContainer
1924          (new SubProgressMonitor(progressMonitor, 1),
1925           Generator.EMF_EDITOR_PROJECT_STYLE,
1926           getEffectiveModelPluginVariables(),
1927           new Path(getEditorDirectory()),
1928           true);
1929      }
1930
1931      progressMonitor.subTask(CodeGenEcorePlugin.INSTANCE.getString("_UI_GeneratingEditorPackages"));
1932      for (Iterator JavaDoc iter = getGenPackages().iterator(); iter.hasNext(); )
1933      {
1934        GenPackage genPackage = (GenPackage)iter.next();
1935        progressMonitor.subTask
1936          (CodeGenEcorePlugin.INSTANCE.getString
1937             ("_UI_GeneratingJavaPackage_message", new Object JavaDoc [] { genPackage.getInterfacePackageName() }));
1938        genPackage.generateEditor(new SubProgressMonitor(progressMonitor, 1));
1939      }
1940
1941      progressMonitor.subTask
1942        (CodeGenEcorePlugin.INSTANCE.getString
1943           ("_UI_GeneratingJavaClass_message", new Object JavaDoc [] { getQualifiedEditorPluginClassName() }));
1944      generate
1945        (new SubProgressMonitor(progressMonitor, 1),
1946         Generator.EMF_EDITOR_PROJECT_STYLE,
1947         getEffectiveModelPluginVariables(),
1948         getEditorPluginDirectory(),
1949         getEditorPluginPackageName(),
1950         getEditorPluginClassName(),
1951         getEditorPluginClassEmitter());
1952
1953      if (isBundleManifest())
1954      {
1955        progressMonitor.subTask(CodeGenEcorePlugin.INSTANCE.getString("_UI_GeneratingEditorManifestMF_message"));
1956        generate
1957          (new SubProgressMonitor(progressMonitor, 1),
1958           Generator.EMF_EDITOR_PROJECT_STYLE,
1959           getEffectiveModelPluginVariables(),
1960           getEditorProjectDirectory() + "/META-INF/MANIFEST.MF",
1961           getEditorManifestMFEmitter());
1962      }
1963      
1964      progressMonitor.subTask(CodeGenEcorePlugin.INSTANCE.getString("_UI_GeneratingEditorPluginXML_message"));
1965      generate
1966        (new SubProgressMonitor(progressMonitor, 1),
1967         Generator.EMF_EDITOR_PROJECT_STYLE,
1968         getEffectiveModelPluginVariables(),
1969         getEditorProjectDirectory() + "/plugin.xml",
1970         getEditorPluginXMLEmitter());
1971            
1972      progressMonitor.subTask(CodeGenEcorePlugin.INSTANCE.getString("_UI_GeneratingEditorPluginProperties_message"));
1973      generate
1974        (new SubProgressMonitor(progressMonitor, 1),
1975         Generator.EMF_EDITOR_PROJECT_STYLE,
1976         getEffectiveModelPluginVariables(),
1977         getEditorProjectDirectory() + "/plugin.properties",
1978         getEditorPluginPropertiesEmitter());
1979
1980      progressMonitor.subTask(CodeGenEcorePlugin.INSTANCE.getString("_UI_GeneratingEditorBuildProperties_message"));
1981      generate
1982        (new SubProgressMonitor(progressMonitor, 1),
1983         Generator.EMF_EDITOR_PROJECT_STYLE,
1984         getEffectiveModelPluginVariables(),
1985         getEditorProjectDirectory() + "/build.properties",
1986         getEditorBuildPropertiesEmitter());
1987      
1988      if (getGenModel().isRichClientPlatform())
1989      {
1990        progressMonitor.subTask
1991        (CodeGenEcorePlugin.INSTANCE.getString
1992           ("_UI_GeneratingJavaClass_message", new Object JavaDoc [] { getQualifiedEditorAdvisorClassName() }));
1993      generate
1994        (new SubProgressMonitor(progressMonitor, 1),
1995         Generator.EMF_EDITOR_PROJECT_STYLE,
1996         getEffectiveModelPluginVariables(),
1997         getEditorPluginDirectory(),
1998         getEditorPluginPackageName(),
1999         getEditorAdvisorClassName(),
2000         getEditorAdvisorEmitter());
2001      }
2002    }
2003    finally
2004    {
2005      progressMonitor.done();
2006    }
2007  }
2008  
2009  public boolean canGenerateSchema()
2010  {
2011    return canGenerate();
2012  }
2013  
2014  public void generateSchema(IProgressMonitor progressMonitor)
2015  {
2016    for (Iterator JavaDoc i = getGenPackages().iterator(); i.hasNext();)
2017    {
2018      ((GenPackage)i.next()).generateSchema(new SubProgressMonitor(progressMonitor, 1));
2019    }
2020  }
2021  
2022  public boolean hasTestSupport()
2023  {
2024    return hasModelSupport() && !isBlank(getTestsDirectory());
2025  }
2026
2027  public boolean canGenerateTests()
2028  {
2029    return canGenerate && hasTestSupport();
2030  }
2031
2032  public void generateTests(IProgressMonitor progressMonitor)
2033  {
2034    try
2035    {
2036      if (!canGenerateTests())
2037        return;
2038
2039      progressMonitor.beginTask("", getGenPackages().size() + 4);
2040
2041      if (isUpdateClasspath())
2042      {
2043        findOrCreateContainer(
2044          new SubProgressMonitor(progressMonitor, 1),
2045          Generator.EMF_TESTS_PROJECT_STYLE,
2046          getEffectiveModelPluginVariables(),
2047          new Path(getTestsDirectory()),
2048          true);
2049      }
2050
2051      progressMonitor.subTask(CodeGenEcorePlugin.INSTANCE.getString("_UI_GeneratingTestsPackages_message"));
2052      for (Iterator JavaDoc genPackages = getGenPackages().iterator(); genPackages.hasNext();)
2053      {
2054        GenPackage genPackage = (GenPackage)genPackages.next();
2055        progressMonitor.subTask(CodeGenEcorePlugin.INSTANCE.getString(
2056          "_UI_GeneratingJavaPackage_message",
2057          new Object JavaDoc []{ genPackage.getTestsPackageName() }));
2058        genPackage.generateTests(new SubProgressMonitor(progressMonitor, 1));
2059      }
2060
2061      if (!isBlank(getTestSuiteClass()))
2062      {
2063        progressMonitor.subTask(CodeGenEcorePlugin.INSTANCE.getString(
2064          "_UI_GeneratingJavaClass_message",
2065          new Object JavaDoc []{ getQualifiedTestSuiteClassName() }));
2066        generate(
2067          new SubProgressMonitor(progressMonitor, 1),
2068          Generator.EMF_TESTS_PROJECT_STYLE,
2069          getEffectiveModelPluginVariables(),
2070          getTestsDirectory(),
2071          getTestSuitePackageName(),
2072          getTestSuiteClassName(),
2073          getModelTestSuiteEmitter());
2074      }
2075
2076      if (!sameModelTestsProject())
2077      {
2078        if (isBundleManifest())
2079        {
2080          progressMonitor.subTask(CodeGenEcorePlugin.INSTANCE.getString("_UI_GeneratingTestsManifestMF_message"));
2081          generate
2082            (new SubProgressMonitor(progressMonitor, 1),
2083             Generator.EMF_TESTS_PROJECT_STYLE,
2084             getEffectiveModelPluginVariables(),
2085             getTestsProjectDirectory() + "/META-INF/MANIFEST.MF",
2086             getTestsManifestMFEmitter());
2087        }
2088        
2089        progressMonitor.subTask(CodeGenEcorePlugin.INSTANCE.getString("_UI_GeneratingTestsPluginXML_message"));
2090        generate(
2091          new SubProgressMonitor(progressMonitor, 1),
2092          Generator.EMF_TESTS_PROJECT_STYLE,
2093          getEffectiveModelPluginVariables(),
2094          getTestsProjectDirectory() + "/plugin.xml",
2095          getTestsPluginXMLEmitter());
2096        
2097        progressMonitor.subTask(CodeGenEcorePlugin.INSTANCE.getString("_UI_GeneratingTestsPluginProperties_message"));
2098        generate(
2099          new SubProgressMonitor(progressMonitor, 1),
2100          Generator.EMF_TESTS_PROJECT_STYLE,
2101          getEffectiveModelPluginVariables(),
2102          getTestsProjectDirectory() + "/plugin.properties",
2103          getTestsPluginPropertiesEmitter());
2104
2105        progressMonitor.subTask(CodeGenEcorePlugin.INSTANCE.getString("_UI_GeneratingTestsBuildProperties_message"));
2106        generate(
2107          new SubProgressMonitor(progressMonitor, 1),
2108          Generator.EMF_TESTS_PROJECT_STYLE,
2109          getEffectiveModelPluginVariables(),
2110          getTestsProjectDirectory() + "/build.properties",
2111          getTestsBuildPropertiesEmitter());
2112      }
2113    }
2114    finally
2115    {
2116      progressMonitor.done();
2117    }
2118  }
2119  
2120  //
2121
// EMFEdit generation
2122
//
2123

2124  protected String JavaDoc itemProviderTemplateName = "edit/ItemProvider.javajet";
2125  protected String JavaDoc itemProviderAdapterFactoryTemplateName = "edit/ItemProviderAdapterFactory.javajet";
2126  protected String JavaDoc editPluginTemplateName = "edit/Plugin.javajet";
2127  protected String JavaDoc editPluginXMLTemplateName = "edit/plugin.xmljet";
2128  protected String JavaDoc editManifestMFTemplateName = "edit/manifest.mfjet";
2129  protected String JavaDoc editPluginPropertiesTemplateName = "edit/plugin.propertiesjet";
2130  protected String JavaDoc editBuildPropertiesTemplateName = "edit/build.propertiesjet";
2131  protected String JavaDoc itemGIFName = "edit/Item.gif";
2132  protected String JavaDoc createChildGIFName = "edit/CreateChild.gif";
2133
2134  protected String JavaDoc editorTemplateName = "editor/Editor.javajet";
2135  protected String JavaDoc actionBarContributorTemplateName = "editor/ActionBarContributor.javajet";
2136  protected String JavaDoc modelWizardTemplateName = "editor/ModelWizard.javajet";
2137  protected String JavaDoc advisorTemplateName = "editor/Advisor.javajet";
2138  protected String JavaDoc editorPluginTemplateName = "editor/Plugin.javajet";
2139  protected String JavaDoc editorPluginXMLTemplateName = "editor/plugin.xmljet";
2140  protected String JavaDoc editorManifestMFTemplateName = "editor/manifest.mfjet";
2141  protected String JavaDoc editorPluginPropertiesTemplateName = "editor/plugin.propertiesjet";
2142  protected String JavaDoc editorBuildPropertiesTemplateName = "editor/build.propertiesjet";
2143  protected String JavaDoc modelGIFName = "editor/ModelFile.gif";
2144  protected String JavaDoc modelWizardGIFName = "editor/NewModel.gif";
2145
2146  protected JETEmitter itemProviderEmitter = null;
2147 // protected JETEmitter extendedItemProviderEmitter = null;
2148
protected JETEmitter itemProviderAdapterFactoryEmitter = null;
2149  protected JETEmitter editPluginClassEmitter = null;
2150  protected JETEmitter editPluginXMLEmitter = null;
2151  protected JETEmitter editManifestMFEmitter = null;
2152  protected JETEmitter editPluginPropertiesEmitter = null;
2153  protected JETEmitter editBuildPropertiesEmitter = null;
2154  protected GIFEmitter itemGIFEmitter = null;
2155  protected GIFEmitter createChildGIFEmitter = null;
2156
2157  protected JETEmitter editorEmitter = null;
2158  protected JETEmitter actionBarContributorEmitter = null;
2159  protected JETEmitter modelWizardEmitter = null;
2160  protected JETEmitter advisorEmitter = null;
2161  protected JETEmitter editorPluginClassEmitter = null;
2162  protected JETEmitter editorManifestMFEmitter = null;
2163  protected JETEmitter editorPluginXMLEmitter = null;
2164  protected JETEmitter editorPluginPropertiesEmitter = null;
2165  protected JETEmitter editorBuildPropertiesEmitter = null;
2166  protected GIFEmitter modelGIFEmitter = null;
2167  protected GIFEmitter modelWizardGIFEmitter = null;
2168
2169  public JETEmitter getItemProviderEmitter()
2170  {
2171    if (itemProviderEmitter == null)
2172    {
2173      itemProviderEmitter = createJETEmitter(itemProviderTemplateName);
2174      setMethod(itemProviderEmitter, "org.eclipse.emf.codegen.ecore.templates.edit.ItemProvider");
2175    }
2176    return itemProviderEmitter;
2177  }
2178
2179 // public JETEmitter getExtendedItemProviderEmitter()
2180
// {
2181
// if (extendedItemProviderEmitter == null)
2182
// {
2183
// extendedItemProviderEmitter = createJETEmitter(extendedItemProviderTemplateName);
2184
// setMethod(extendedItemProviderEmitter, "org.eclipse.emf.codegen.ecore.templates.edit.ExtendedItemProvider");
2185
// }
2186
// return extendedItemProviderEmitter;
2187
// }
2188

2189  public JETEmitter getItemProviderAdapterFactoryEmitter()
2190  {
2191    if (itemProviderAdapterFactoryEmitter == null)
2192    {
2193      itemProviderAdapterFactoryEmitter = createJETEmitter(itemProviderAdapterFactoryTemplateName);
2194      setMethod(itemProviderAdapterFactoryEmitter, "org.eclipse.emf.codegen.ecore.templates.edit.ItemProviderAdapterFactory");
2195    }
2196    return itemProviderAdapterFactoryEmitter;
2197  }
2198
2199  public JETEmitter getEditPluginClassEmitter()
2200  {
2201    if (editPluginClassEmitter == null)
2202    {
2203      editPluginClassEmitter = createJETEmitter(editPluginTemplateName);
2204      setMethod(editPluginClassEmitter, "org.eclipse.emf.codegen.ecore.templates.edit.Plugin");
2205    }
2206    return editPluginClassEmitter;
2207  }
2208
2209  public JETEmitter getEditPluginXMLEmitter()
2210  {
2211    if (editPluginXMLEmitter == null)
2212    {
2213      editPluginXMLEmitter = createJETEmitter(editPluginXMLTemplateName);
2214      setMethod(editPluginXMLEmitter, "org.eclipse.emf.codegen.ecore.templates.edit.PluginXML");
2215    }
2216    return editPluginXMLEmitter;
2217  }
2218  
2219  public JETEmitter getEditManifestMFEmitter()
2220  {
2221    if (editManifestMFEmitter == null)
2222    {
2223      editManifestMFEmitter = createJETEmitter(editManifestMFTemplateName);
2224      setMethod(editManifestMFEmitter, "org.eclipse.emf.codegen.ecore.templates.edit.ManifestMF");
2225    }
2226
2227    return editManifestMFEmitter;
2228  }
2229
2230  public JETEmitter getEditPluginPropertiesEmitter()
2231  {
2232    if (editPluginPropertiesEmitter == null)
2233    {
2234      editPluginPropertiesEmitter = createJETEmitter(editPluginPropertiesTemplateName);
2235      setMethod(editPluginPropertiesEmitter, "org.eclipse.emf.codegen.ecore.templates.edit.PluginProperties");
2236    }
2237    return editPluginPropertiesEmitter;
2238  }
2239
2240  public JETEmitter getEditBuildPropertiesEmitter()
2241  {
2242    if (editBuildPropertiesEmitter == null)
2243    {
2244      editBuildPropertiesEmitter = createJETEmitter(editBuildPropertiesTemplateName);
2245      setMethod(editBuildPropertiesEmitter, "org.eclipse.emf.codegen.ecore.templates.edit.BuildProperties");
2246    }
2247    return editBuildPropertiesEmitter;
2248  }
2249  
2250  public GIFEmitter getItemGIFEmitter()
2251  {
2252    if (itemGIFEmitter == null)
2253    {
2254      itemGIFEmitter = new GIFEmitter(JETCompiler.find(getTemplatePath(), itemGIFName));
2255    }
2256    return itemGIFEmitter;
2257  }
2258
2259  public GIFEmitter getCreateChildGIFEmitter()
2260  {
2261    if (createChildGIFEmitter == null)
2262    {
2263      createChildGIFEmitter = new GIFEmitter(JETCompiler.find(getTemplatePath(), createChildGIFName));
2264    }
2265    return createChildGIFEmitter;
2266  }
2267
2268  public GIFEmitter getModelGIFEmitter()
2269  {
2270    if (modelGIFEmitter == null)
2271    {
2272      modelGIFEmitter = new GIFEmitter(JETCompiler.find(getTemplatePath(), modelGIFName));
2273    }
2274    return modelGIFEmitter;
2275  }
2276
2277  public GIFEmitter getModelWizardGIFEmitter()
2278  {
2279    if (modelWizardGIFEmitter == null)
2280    {
2281      modelWizardGIFEmitter = new GIFEmitter(JETCompiler.find(getTemplatePath(), modelWizardGIFName));
2282    }
2283    return modelWizardGIFEmitter;
2284  }
2285
2286  public JETEmitter getEditorEmitter()
2287  {
2288    if (editorEmitter == null)
2289    {
2290      editorEmitter = createJETEmitter(editorTemplateName);
2291      setMethod(editorEmitter, "org.eclipse.emf.codegen.ecore.templates.editor.Editor");
2292    }
2293    return editorEmitter;
2294  }
2295
2296  public JETEmitter getActionBarContributorEmitter()
2297  {
2298    if (actionBarContributorEmitter == null)
2299    {
2300      actionBarContributorEmitter = createJETEmitter(actionBarContributorTemplateName);
2301      setMethod(actionBarContributorEmitter, "org.eclipse.emf.codegen.ecore.templates.editor.ActionBarContributor");
2302    }
2303    return actionBarContributorEmitter;
2304  }
2305
2306  public JETEmitter getModelWizardEmitter()
2307  {
2308    if (modelWizardEmitter == null)
2309    {
2310      modelWizardEmitter = createJETEmitter(modelWizardTemplateName);
2311      setMethod(modelWizardEmitter, "org.eclipse.emf.codegen.ecore.templates.editor.ModelWizard");
2312    }
2313    return modelWizardEmitter;
2314  }
2315
2316  public JETEmitter getEditorAdvisorEmitter()
2317  {
2318    if (advisorEmitter == null)
2319    {
2320      advisorEmitter = createJETEmitter(advisorTemplateName);
2321      setMethod(advisorEmitter, "org.eclipse.emf.codegen.ecore.templates.editor.Advisor");
2322    }
2323    return advisorEmitter;
2324  }
2325
2326  public JETEmitter getEditorPluginClassEmitter()
2327  {
2328    if (editorPluginClassEmitter == null)
2329    {
2330      editorPluginClassEmitter = createJETEmitter(editorPluginTemplateName);
2331      setMethod(editorPluginClassEmitter, "org.eclipse.emf.codegen.ecore.templates.editor.Plugin");
2332    }
2333    return editorPluginClassEmitter;
2334  }
2335
2336  public JETEmitter getEditorPluginXMLEmitter()
2337  {
2338    if (editorPluginXMLEmitter == null)
2339    {
2340      editorPluginXMLEmitter = createJETEmitter(editorPluginXMLTemplateName);
2341      setMethod(editorPluginXMLEmitter, "org.eclipse.emf.codegen.ecore.templates.editor.PluginXML");
2342    }
2343    return editorPluginXMLEmitter;
2344  }
2345
2346  public JETEmitter getEditorManifestMFEmitter()
2347  {
2348    if (editorManifestMFEmitter == null)
2349    {
2350      editorManifestMFEmitter = createJETEmitter(editorManifestMFTemplateName);
2351      setMethod(editorManifestMFEmitter, "org.eclipse.emf.codegen.ecore.templates.editor.ManifestMF");
2352    }
2353
2354    return editorManifestMFEmitter;
2355  }
2356  
2357  public JETEmitter getEditorPluginPropertiesEmitter()
2358  {
2359    if (editorPluginPropertiesEmitter == null)
2360    {
2361      editorPluginPropertiesEmitter = createJETEmitter(editorPluginPropertiesTemplateName);
2362      setMethod(editorPluginPropertiesEmitter, "org.eclipse.emf.codegen.ecore.templates.editor.PluginProperties");
2363    }
2364    return editorPluginPropertiesEmitter;
2365  }
2366
2367  public JETEmitter getEditorBuildPropertiesEmitter()
2368  {
2369    if (editorBuildPropertiesEmitter == null)
2370    {
2371      editorBuildPropertiesEmitter = createJETEmitter(editorBuildPropertiesTemplateName);
2372      setMethod(editorBuildPropertiesEmitter, "org.eclipse.emf.codegen.ecore.templates.editor.BuildProperties");
2373    }
2374    return editorBuildPropertiesEmitter;
2375  }
2376
2377  //
2378
// Tests generation
2379
//
2380

2381  protected String JavaDoc testCaseTemplateName = "model.tests/TestCase.javajet";
2382  protected String JavaDoc modelTestSuiteTemplateName = "model.tests/ModelTestSuite.javajet";
2383  protected String JavaDoc packageTestSuiteTemplateName = "model.tests/PackageTestSuite.javajet";
2384  protected String JavaDoc packageExampleTemplateName = "model.tests/PackageExample.javajet";
2385  protected String JavaDoc testsPluginXMLTemplateName = "model.tests/plugin.xmljet";
2386  protected String JavaDoc testsManifestMFTemplateName = "model.tests/manifest.mfjet";
2387  protected String JavaDoc testsPluginPropertiesTemplateName = "model.tests/plugin.propertiesjet";
2388  protected String JavaDoc testsBuildPropertiesTemplateName = "model.tests/build.propertiesjet";
2389
2390  protected JETEmitter testCaseEmitter = null;
2391  protected JETEmitter modelTestSuiteEmitter = null;
2392  protected JETEmitter packageTestSuiteEmitter = null;
2393  protected JETEmitter packageExampleEmitter = null;
2394  protected JETEmitter testsPluginXMLEmitter = null;
2395  protected JETEmitter testsManifestMFEmitter = null;
2396  protected JETEmitter testsPluginPropertiesEmitter = null;
2397  protected JETEmitter testsBuildPropertiesEmitter = null;
2398
2399  public JETEmitter getTestCaseEmitter()
2400  {
2401    if (testCaseEmitter == null)
2402    {
2403      testCaseEmitter = createJETEmitter(testCaseTemplateName);
2404      setMethod(testCaseEmitter, "org.eclipse.emf.codegen.ecore.templates.model.tests.TestCase");
2405    }
2406
2407    return testCaseEmitter;
2408  }
2409
2410  public JETEmitter getModelTestSuiteEmitter()
2411  {
2412    if (modelTestSuiteEmitter == null)
2413    {
2414      modelTestSuiteEmitter = createJETEmitter(modelTestSuiteTemplateName);
2415      setMethod(modelTestSuiteEmitter, "org.eclipse.emf.codegen.ecore.templates.model.tests.ModelTestSuite");
2416    }
2417
2418    return modelTestSuiteEmitter;
2419  }
2420
2421  public JETEmitter getPackageTestSuiteEmitter()
2422  {
2423    if (packageTestSuiteEmitter == null)
2424    {
2425      packageTestSuiteEmitter = createJETEmitter(packageTestSuiteTemplateName);
2426      setMethod(packageTestSuiteEmitter, "org.eclipse.emf.codegen.ecore.templates.model.tests.PackageTestSuite");
2427    }
2428
2429    return packageTestSuiteEmitter;
2430  }
2431  
2432  public JETEmitter getPackageExampleEmitter()
2433  {
2434    if (packageExampleEmitter == null)
2435    {
2436      packageExampleEmitter = createJETEmitter(packageExampleTemplateName);
2437      setMethod(packageExampleEmitter, "org.eclipse.emf.codegen.ecore.templates.model.tests.PackageExample");
2438    }
2439
2440    return packageExampleEmitter;
2441  }
2442
2443  public JETEmitter getTestsPluginXMLEmitter()
2444  {
2445    if (testsPluginXMLEmitter == null)
2446    {
2447      testsPluginXMLEmitter = createJETEmitter(testsPluginXMLTemplateName);
2448      setMethod(testsPluginXMLEmitter, "org.eclipse.emf.codegen.ecore.templates.model.tests.PluginXML");
2449    }
2450
2451    return testsPluginXMLEmitter;
2452  }
2453
2454  public JETEmitter getTestsManifestMFEmitter()
2455  {
2456    if (testsManifestMFEmitter == null)
2457    {
2458      testsManifestMFEmitter = createJETEmitter(testsManifestMFTemplateName);
2459      setMethod(testsManifestMFEmitter, "org.eclipse.emf.codegen.ecore.templates.model.tests.ManifestMF");
2460    }
2461
2462    return testsManifestMFEmitter;
2463  }
2464
2465  public JETEmitter getTestsPluginPropertiesEmitter()
2466  {
2467    if (testsPluginPropertiesEmitter == null)
2468    {
2469      testsPluginPropertiesEmitter = createJETEmitter(testsPluginPropertiesTemplateName);
2470      setMethod(testsPluginPropertiesEmitter, "org.eclipse.emf.codegen.ecore.templates.model.tests.PluginProperties");
2471    }
2472
2473    return testsPluginPropertiesEmitter;
2474  }
2475
2476  public JETEmitter getTestsBuildPropertiesEmitter()
2477  {
2478    if (testsBuildPropertiesEmitter == null)
2479    {
2480      testsBuildPropertiesEmitter = createJETEmitter(testsBuildPropertiesTemplateName);
2481      setMethod(testsBuildPropertiesEmitter, "org.eclipse.emf.codegen.ecore.templates.model.tests.BuildProperties");
2482    }
2483
2484    return testsBuildPropertiesEmitter;
2485  }
2486
2487  protected String JavaDoc getPluginDirectory(boolean isSet, String JavaDoc baseDirectory, String JavaDoc suffix)
2488  {
2489    if (!isSet)
2490    {
2491      String JavaDoc modelProject = getModelProject();
2492      if (modelProject != null)
2493      {
2494        return new StringBuffer JavaDoc("/").append(modelProject).append(suffix).append(getSourceFragmentPath()).toString();
2495      }
2496    }
2497    return baseDirectory;
2498  }
2499  
2500  public String JavaDoc getEditDirectory()
2501  {
2502    return getPluginDirectory(isSetEditDirectory(), getEditDirectoryGen(), ".edit/");
2503  }
2504
2505  /**
2506   * <!-- begin-user-doc -->
2507   * <!-- end-user-doc -->
2508   * @generated
2509   */

2510  public String JavaDoc getEditDirectoryGen()
2511  {
2512    return editDirectory;
2513  }
2514
2515  /**
2516   * <!-- begin-user-doc -->
2517   * <!-- end-user-doc -->
2518   * @generated
2519   */

2520  public void setEditDirectory(String JavaDoc newEditDirectory)
2521  {
2522    String JavaDoc oldEditDirectory = editDirectory;
2523    editDirectory = newEditDirectory;
2524    boolean oldEditDirectoryESet = editDirectoryESet;
2525    editDirectoryESet = true;
2526    if (eNotificationRequired())
2527      eNotify(new ENotificationImpl(this, Notification.SET, GenModelPackage.GEN_MODEL__EDIT_DIRECTORY, oldEditDirectory, editDirectory, !oldEditDirectoryESet));
2528  }
2529
2530  /**
2531   * <!-- begin-user-doc -->
2532   * <!-- end-user-doc -->
2533   * @generated
2534   */

2535  public void unsetEditDirectory()
2536  {
2537    String JavaDoc oldEditDirectory = editDirectory;
2538    boolean oldEditDirectoryESet = editDirectoryESet;
2539    editDirectory = EDIT_DIRECTORY_EDEFAULT;
2540    editDirectoryESet = false;
2541    if (eNotificationRequired())
2542      eNotify(new ENotificationImpl(this, Notification.UNSET, GenModelPackage.GEN_MODEL__EDIT_DIRECTORY, oldEditDirectory, EDIT_DIRECTORY_EDEFAULT, oldEditDirectoryESet));
2543  }
2544
2545  /**
2546   * <!-- begin-user-doc -->
2547   * <!-- end-user-doc -->
2548   * @generated
2549   */

2550  public boolean isSetEditDirectory()
2551  {
2552    return editDirectoryESet;
2553  }
2554
2555  public String JavaDoc getEditorDirectory()
2556  {
2557    return getPluginDirectory(isSetEditorDirectory(), getEditorDirectoryGen(), ".editor/");
2558  }
2559
2560  /**
2561   * <!-- begin-user-doc -->
2562   * <!-- end-user-doc -->
2563   * @generated
2564   */

2565  public String JavaDoc getEditorDirectoryGen()
2566  {
2567    return editorDirectory;
2568  }
2569
2570  /**
2571   * <!-- begin-user-doc -->
2572   * <!-- end-user-doc -->
2573   * @generated
2574   */

2575  public void setEditorDirectory(String JavaDoc newEditorDirectory)
2576  {
2577    String JavaDoc oldEditorDirectory = editorDirectory;
2578    editorDirectory = newEditorDirectory;
2579    boolean oldEditorDirectoryESet = editorDirectoryESet;
2580    editorDirectoryESet = true;
2581    if (eNotificationRequired())
2582      eNotify(new ENotificationImpl(this, Notification.SET, GenModelPackage.GEN_MODEL__EDITOR_DIRECTORY, oldEditorDirectory, editorDirectory, !oldEditorDirectoryESet));
2583  }
2584
2585  /**
2586   * <!-- begin-user-doc -->
2587   * <!-- end-user-doc -->
2588   * @generated
2589   */

2590  public void unsetEditorDirectory()
2591  {
2592    String JavaDoc oldEditorDirectory = editorDirectory;
2593    boolean oldEditorDirectoryESet = editorDirectoryESet;
2594    editorDirectory = EDITOR_DIRECTORY_EDEFAULT;
2595    editorDirectoryESet = false;
2596    if (eNotificationRequired())
2597      eNotify(new ENotificationImpl(this, Notification.UNSET, GenModelPackage.GEN_MODEL__EDITOR_DIRECTORY, oldEditorDirectory, EDITOR_DIRECTORY_EDEFAULT, oldEditorDirectoryESet));
2598  }
2599
2600  /**
2601   * <!-- begin-user-doc -->
2602   * <!-- end-user-doc -->
2603   * @generated
2604   */

2605  public boolean isSetEditorDirectory()
2606  {
2607    return editorDirectoryESet;
2608  }
2609
2610  /**
2611   * <!-- begin-user-doc -->
2612   * <!-- end-user-doc -->
2613   * @generated
2614   */

2615  public String JavaDoc getModelPluginID()
2616  {
2617    return modelPluginID;
2618  }
2619
2620  /**
2621   * <!-- begin-user-doc -->
2622   * <!-- end-user-doc -->
2623   * @generated
2624   */

2625  public void setModelPluginID(String JavaDoc newModelPluginID)
2626  {
2627    String JavaDoc oldModelPluginID = modelPluginID;
2628    modelPluginID = newModelPluginID;
2629    if (eNotificationRequired())
2630      eNotify(new ENotificationImpl(this, Notification.SET, GenModelPackage.GEN_MODEL__MODEL_PLUGIN_ID, oldModelPluginID, modelPluginID));
2631  }
2632
2633  /**
2634   * <!-- begin-user-doc -->
2635   * <!-- end-user-doc -->
2636   * @generated
2637   */

2638  public String JavaDoc getTemplateDirectory()
2639  {
2640    return templateDirectory;
2641  }
2642
2643  /**
2644   * <!-- begin-user-doc -->
2645   * <!-- end-user-doc -->
2646   * @generated
2647   */

2648  public void setTemplateDirectory(String JavaDoc newTemplateDirectory)
2649  {
2650    String JavaDoc oldTemplateDirectory = templateDirectory;
2651    templateDirectory = newTemplateDirectory;
2652    if (eNotificationRequired())
2653      eNotify(new ENotificationImpl(this, Notification.SET, GenModelPackage.GEN_MODEL__TEMPLATE_DIRECTORY, oldTemplateDirectory, templateDirectory));
2654  }
2655
2656  /**
2657   * <!-- begin-user-doc -->
2658   * <!-- end-user-doc -->
2659   * @generated
2660   */

2661  public boolean isRuntimeJar()
2662  {
2663    return runtimeJar;
2664  }
2665
2666  /**
2667   * <!-- begin-user-doc -->
2668   * <!-- end-user-doc -->
2669   * @generated
2670   */

2671  public void setRuntimeJar(boolean newRuntimeJar)
2672  {
2673    boolean oldRuntimeJar = runtimeJar;
2674    runtimeJar = newRuntimeJar;
2675    if (eNotificationRequired())
2676      eNotify(new ENotificationImpl(this, Notification.SET, GenModelPackage.GEN_MODEL__RUNTIME_JAR, oldRuntimeJar, runtimeJar));
2677  }
2678
2679  /**
2680   * <!-- begin-user-doc -->
2681   * <!-- end-user-doc -->
2682   * @generated
2683   */

2684  public EList getForeignModel()
2685  {
2686    if (foreignModel == null)
2687    {
2688      foreignModel = new EDataTypeUniqueEList(String JavaDoc.class, this, GenModelPackage.GEN_MODEL__FOREIGN_MODEL);
2689    }
2690    return foreignModel;
2691  }
2692
2693  /**
2694   * <!-- begin-user-doc -->
2695   * <!-- end-user-doc -->
2696   * @generated
2697   */

2698  public boolean isDynamicTemplates()
2699  {
2700    return dynamicTemplates;
2701  }
2702
2703  /**
2704   * <!-- begin-user-doc -->
2705   * <!-- end-user-doc -->
2706   * @generated
2707   */

2708  public void setDynamicTemplates(boolean newDynamicTemplates)
2709  {
2710    boolean oldDynamicTemplates = dynamicTemplates;
2711    dynamicTemplates = newDynamicTemplates;
2712    if (eNotificationRequired())
2713      eNotify(new ENotificationImpl(this, Notification.SET, GenModelPackage.GEN_MODEL__DYNAMIC_TEMPLATES, oldDynamicTemplates, dynamicTemplates));
2714  }
2715
2716  /**
2717   * <!-- begin-user-doc -->
2718   * <!-- end-user-doc -->
2719   * @generated
2720   */

2721  public String JavaDoc getRedirection()
2722  {
2723    return redirection;
2724  }
2725
2726  /**
2727   * <!-- begin-user-doc -->
2728   * <!-- end-user-doc -->
2729   * @generated
2730   */

2731  public void setRedirection(String JavaDoc newRedirection)
2732  {
2733    String JavaDoc oldRedirection = redirection;
2734    redirection = newRedirection;
2735    if (eNotificationRequired())
2736      eNotify(new ENotificationImpl(this, Notification.SET, GenModelPackage.GEN_MODEL__REDIRECTION, oldRedirection, redirection));
2737  }
2738
2739  /**
2740   * <!-- begin-user-doc -->
2741   * <!-- end-user-doc -->
2742   * @generated
2743   */

2744  public boolean isForceOverwrite()
2745  {
2746    return forceOverwrite;
2747  }
2748
2749  /**
2750   * <!-- begin-user-doc -->
2751   * <!-- end-user-doc -->
2752   * @generated
2753   */

2754  public void setForceOverwrite(boolean newForceOverwrite)
2755  {
2756    boolean oldForceOverwrite = forceOverwrite;
2757    forceOverwrite = newForceOverwrite;
2758    if (eNotificationRequired())
2759      eNotify(new ENotificationImpl(this, Notification.SET, GenModelPackage.GEN_MODEL__FORCE_OVERWRITE, oldForceOverwrite, forceOverwrite));
2760  }
2761
2762  /**
2763   * <!-- begin-user-doc -->
2764   * <!-- end-user-doc -->
2765   * @generated
2766   */

2767  public String JavaDoc getNonExternalizedStringTag()
2768  {
2769    return nonExternalizedStringTag;
2770  }
2771
2772  /**
2773   * <!-- begin-user-doc -->
2774   * <!-- end-user-doc -->
2775   * @generated
2776   */

2777  public void setNonExternalizedStringTagGen(String JavaDoc newNonExternalizedStringTag)
2778  {
2779    String JavaDoc oldNonExternalizedStringTag = nonExternalizedStringTag;
2780    nonExternalizedStringTag = newNonExternalizedStringTag;
2781    if (eNotificationRequired())
2782      eNotify(new ENotificationImpl(this, Notification.SET, GenModelPackage.GEN_MODEL__NON_EXTERNALIZED_STRING_TAG, oldNonExternalizedStringTag, nonExternalizedStringTag));
2783  }
2784
2785  public void setNonExternalizedStringTag(String JavaDoc newNonExternalizedStringTag)
2786  {
2787    setNonNLSMarkersGen(newNonExternalizedStringTag != null);
2788    setNonExternalizedStringTagGen(null);
2789  }
2790
2791  public String JavaDoc getName()
2792  {
2793    return getModelName();
2794  }
2795
2796  /**
2797   * <!-- begin-user-doc -->
2798   * <!-- end-user-doc -->
2799   * @generated
2800   */

2801  public String JavaDoc getModelName()
2802  {
2803    return modelName;
2804  }
2805
2806  /**
2807   * <!-- begin-user-doc -->
2808   * <!-- end-user-doc -->
2809   * @generated
2810   */

2811  public void setModelName(String JavaDoc newModelName)
2812  {
2813    String JavaDoc oldModelName = modelName;
2814    modelName = newModelName;
2815    if (eNotificationRequired())
2816      eNotify(new ENotificationImpl(this, Notification.SET, GenModelPackage.GEN_MODEL__MODEL_NAME, oldModelName, modelName));
2817  }
2818
2819  /**
2820   * <!-- begin-user-doc -->
2821   * <!-- end-user-doc -->
2822   * @generated
2823   */

2824  public String JavaDoc getModelPluginClass()
2825  {
2826    return modelPluginClass;
2827  }
2828
2829  protected String JavaDoc getPluginClass(boolean isSet, String JavaDoc baseName, String JavaDoc packageSuffix, String JavaDoc classSuffix)
2830  {
2831    if (!isSet)
2832    {
2833      String JavaDoc modelName = getModelName();
2834      if (!isBlank(modelName))
2835      {
2836        String JavaDoc mainPackage = getMainPackage();
2837        if (mainPackage != null)
2838        {
2839          StringBuffer JavaDoc pluginClass = new StringBuffer JavaDoc(mainPackage);
2840          if (!isBlank(packageSuffix))
2841          {
2842            pluginClass.append(".").append(packageSuffix);
2843          }
2844          pluginClass.append(".").append(CodeGenUtil.validJavaIdentifier(modelName)). append(classSuffix);
2845          return pluginClass.toString();
2846        }
2847      }
2848    }
2849    return baseName;
2850  }
2851  
2852  /**
2853   * <!-- begin-user-doc -->
2854   * <!-- end-user-doc -->
2855   * @generated
2856   */

2857  public void setModelPluginClass(String JavaDoc newModelPluginClass)
2858  {
2859    String JavaDoc oldModelPluginClass = modelPluginClass;
2860    modelPluginClass = newModelPluginClass;
2861    if (eNotificationRequired())
2862      eNotify(new ENotificationImpl(this, Notification.SET, GenModelPackage.GEN_MODEL__MODEL_PLUGIN_CLASS, oldModelPluginClass, modelPluginClass));
2863  }
2864
2865  public String JavaDoc getEditPluginClass()
2866  {
2867    String JavaDoc suffix = GenPackageImpl.PROVIDER_PACKAGE_SUFFIX_EDEFAULT;
2868    GenPackage genPackage = getMainGenPackage();
2869    if (genPackage != null)
2870    {
2871      suffix = genPackage.getProviderPackageSuffix();
2872    }
2873    return getPluginClass(isSetEditPluginClass(), getEditPluginClassGen(), suffix, "EditPlugin");
2874  }
2875
2876  /**
2877   * <!-- begin-user-doc -->
2878   * <!-- end-user-doc -->
2879   * @generated
2880   */

2881  public String JavaDoc getEditPluginClassGen()
2882  {
2883    return editPluginClass;
2884  }
2885
2886  protected String JavaDoc getModelProject()
2887  {
2888    String JavaDoc modelDirectory = getModelDirectory();
2889    if (!isBlank(modelDirectory))
2890    {
2891      return URI.createURI(modelDirectory).segment(0);
2892    }
2893    return null;
2894  }
2895
2896  protected String JavaDoc getMainPackage()
2897  {
2898    GenPackage genPackage = getMainGenPackage();
2899    return genPackage != null ? genPackage.getQualifiedPackageName() : getModelDirectory();
2900  }
2901  
2902  protected GenPackage getMainGenPackage()
2903  {
2904    if (!getGenPackages().isEmpty())
2905    {
2906      GenPackage genPackage = (GenPackage)getGenPackages().get(0);
2907      while (genPackage.getGenClassifiers().isEmpty() && !genPackage.getNestedGenPackages().isEmpty())
2908      {
2909        genPackage = (GenPackage)genPackage.getNestedGenPackages().get(0);
2910      }
2911      return genPackage;
2912    }
2913    return null;
2914  }
2915
2916  /**
2917   * <!-- begin-user-doc -->
2918   * <!-- end-user-doc -->
2919   * @generated
2920   */

2921  public void setEditPluginClass(String JavaDoc newEditPluginClass)
2922  {
2923    String JavaDoc oldEditPluginClass = editPluginClass;
2924    editPluginClass = newEditPluginClass;
2925    boolean oldEditPluginClassESet = editPluginClassESet;
2926    editPluginClassESet = true;
2927    if (eNotificationRequired())
2928      eNotify(new ENotificationImpl(this, Notification.SET, GenModelPackage.GEN_MODEL__EDIT_PLUGIN_CLASS, oldEditPluginClass, editPluginClass, !oldEditPluginClassESet));
2929  }
2930
2931  /**
2932   * <!-- begin-user-doc -->
2933   * <!-- end-user-doc -->
2934   * @generated
2935   */

2936  public void unsetEditPluginClass()
2937  {
2938    String JavaDoc oldEditPluginClass = editPluginClass;
2939    boolean oldEditPluginClassESet = editPluginClassESet;
2940    editPluginClass = EDIT_PLUGIN_CLASS_EDEFAULT;
2941    editPluginClassESet = false;
2942    if (eNotificationRequired())
2943      eNotify(new ENotificationImpl(this, Notification.UNSET, GenModelPackage.GEN_MODEL__EDIT_PLUGIN_CLASS, oldEditPluginClass, EDIT_PLUGIN_CLASS_EDEFAULT, oldEditPluginClassESet));
2944  }
2945
2946  /**
2947   * <!-- begin-user-doc -->
2948   * <!-- end-user-doc -->
2949   * @generated
2950   */

2951  public boolean isSetEditPluginClass()
2952  {
2953    return editPluginClassESet;
2954  }
2955
2956  public String JavaDoc getEditorPluginClass()
2957  {
2958    String JavaDoc suffix = GenPackageImpl.PRESENTATION_PACKAGE_SUFFIX_EDEFAULT;
2959    GenPackage genPackage = getMainGenPackage();
2960    if (genPackage != null)
2961    {
2962      suffix = genPackage.getPresentationPackageSuffix();
2963    }
2964    return getPluginClass(isSetEditorPluginClass(), getEditorPluginClassGen(), suffix, "EditorPlugin");
2965  }
2966
2967  /**
2968   * <!-- begin-user-doc -->
2969   * <!-- end-user-doc -->
2970   * @generated
2971   */

2972  public String JavaDoc getEditorPluginClassGen()
2973  {
2974    return editorPluginClass;
2975  }
2976
2977  /**
2978   * <!-- begin-user-doc -->
2979   * <!-- end-user-doc -->
2980   * @generated
2981   */

2982  public void setEditorPluginClass(String JavaDoc newEditorPluginClass)
2983  {
2984    String JavaDoc oldEditorPluginClass = editorPluginClass;
2985    editorPluginClass = newEditorPluginClass;
2986    boolean oldEditorPluginClassESet = editorPluginClassESet;
2987    editorPluginClassESet = true;
2988    if (eNotificationRequired())
2989      eNotify(new ENotificationImpl(this, Notification.SET, GenModelPackage.GEN_MODEL__EDITOR_PLUGIN_CLASS, oldEditorPluginClass, editorPluginClass, !oldEditorPluginClassESet));
2990  }
2991
2992  /**
2993   * <!-- begin-user-doc -->
2994   * <!-- end-user-doc -->
2995   * @generated
2996   */

2997  public void unsetEditorPluginClass()
2998  {
2999    String JavaDoc oldEditorPluginClass = editorPluginClass;
3000    boolean oldEditorPluginClassESet = editorPluginClassESet;
3001    editorPluginClass = EDITOR_PLUGIN_CLASS_EDEFAULT;
3002    editorPluginClassESet = false;
3003    if (eNotificationRequired())
3004      eNotify(new ENotificationImpl(this, Notification.UNSET, GenModelPackage.GEN_MODEL__EDITOR_PLUGIN_CLASS, oldEditorPluginClass, EDITOR_PLUGIN_CLASS_EDEFAULT, oldEditorPluginClassESet));
3005  }
3006
3007  /**
3008   * <!-- begin-user-doc -->
3009   * <!-- end-user-doc -->
3010   * @generated
3011   */

3012  public boolean isSetEditorPluginClass()
3013  {
3014    return editorPluginClassESet;
3015  }
3016
3017  /**
3018   * <!-- begin-user-doc -->
3019   * <!-- end-user-doc -->
3020   * @generated
3021   */

3022  public boolean isUpdateClasspath()
3023  {
3024    return updateClasspath;
3025  }
3026
3027  /**
3028   * <!-- begin-user-doc -->
3029   * <!-- end-user-doc -->
3030   * @generated
3031   */

3032  public void setUpdateClasspath(boolean newUpdateClasspath)
3033  {
3034    boolean oldUpdateClasspath = updateClasspath;
3035    updateClasspath = newUpdateClasspath;
3036    if (eNotificationRequired())
3037      eNotify(new ENotificationImpl(this, Notification.SET, GenModelPackage.GEN_MODEL__UPDATE_CLASSPATH, oldUpdateClasspath, updateClasspath));
3038  }
3039
3040  /**
3041   * <!-- begin-user-doc -->
3042   * <!-- end-user-doc -->
3043   * @generated
3044   */

3045  public boolean isGenerateSchema()
3046  {
3047    return generateSchema;
3048  }
3049
3050  /**
3051   * <!-- begin-user-doc -->
3052   * <!-- end-user-doc -->
3053   * @generated
3054   */

3055  public void setGenerateSchema(boolean newGenerateSchema)
3056  {
3057    boolean oldGenerateSchema = generateSchema;
3058    generateSchema = newGenerateSchema;
3059    if (eNotificationRequired())
3060      eNotify(new ENotificationImpl(this, Notification.SET, GenModelPackage.GEN_MODEL__GENERATE_SCHEMA, oldGenerateSchema, generateSchema));
3061  }
3062
3063  /**
3064   * <!-- begin-user-doc -->
3065   * <!-- end-user-doc -->
3066   * @generated
3067   */

3068  public boolean isNonNLSMarkers()
3069  {
3070    return nonNLSMarkers;
3071  }
3072
3073  /**
3074   * <!-- begin-user-doc -->
3075   * <!-- end-user-doc -->
3076   * @generated
3077   */

3078  public void setNonNLSMarkersGen(boolean newNonNLSMarkers)
3079  {
3080    boolean oldNonNLSMarkers = nonNLSMarkers;
3081    nonNLSMarkers = newNonNLSMarkers;
3082    if (eNotificationRequired())
3083      eNotify(new ENotificationImpl(this, Notification.SET, GenModelPackage.GEN_MODEL__NON_NLS_MARKERS, oldNonNLSMarkers, nonNLSMarkers));
3084  }
3085
3086  public void setNonNLSMarkers(boolean newNonNLSMarkers)
3087  {
3088    setNonNLSMarkersGen(newNonNLSMarkers);
3089    setNonExternalizedStringTagGen(null);
3090  }
3091
3092  /**
3093   * <!-- begin-user-doc -->
3094   * <!-- end-user-doc -->
3095   * @generated NOT
3096   */

3097  public EList getStaticPackages()
3098  {
3099    if (staticPackages == null)
3100    {
3101      staticPackages =
3102        new EDataTypeUniqueEList(String JavaDoc.class, this, GenModelPackage.GEN_MODEL__STATIC_PACKAGES)
3103        {
3104          protected void didChange()
3105          {
3106            super.didChange();
3107            staticGenPackages = null;
3108          }
3109        };
3110    }
3111    return staticPackages;
3112  }
3113
3114  /**
3115   * <!-- begin-user-doc -->
3116   * <!-- end-user-doc -->
3117   * @generated
3118   */

3119  public EList getModelPluginVariables()
3120  {
3121    if (modelPluginVariables == null)
3122    {
3123      modelPluginVariables = new EDataTypeUniqueEList(String JavaDoc.class, this, GenModelPackage.GEN_MODEL__MODEL_PLUGIN_VARIABLES);
3124    }
3125    return modelPluginVariables;
3126  }
3127
3128  /**
3129   * <!-- begin-user-doc -->
3130   * <!-- end-user-doc -->
3131   * @generated
3132   */

3133  public String JavaDoc getRootExtendsInterface()
3134  {
3135    return rootExtendsInterface;
3136  }
3137
3138  /**
3139   * <!-- begin-user-doc -->
3140   * <!-- end-user-doc -->
3141   * @generated
3142   */

3143  public void setRootExtendsInterface(String JavaDoc newRootExtendsInterface)
3144  {
3145    String JavaDoc oldRootExtendsInterface = rootExtendsInterface;
3146    rootExtendsInterface = newRootExtendsInterface;
3147    if (eNotificationRequired())
3148      eNotify(new ENotificationImpl(this, Notification.SET, GenModelPackage.GEN_MODEL__ROOT_EXTENDS_INTERFACE, oldRootExtendsInterface, rootExtendsInterface));
3149  }
3150
3151  /**
3152   * <!-- begin-user-doc -->
3153   * <!-- end-user-doc -->
3154   * @generated
3155   */

3156  public String JavaDoc getRootExtendsClass()
3157  {
3158    return rootExtendsClass;
3159  }
3160
3161  /**
3162   * <!-- begin-user-doc -->
3163   * <!-- end-user-doc -->
3164   * @generated
3165   */

3166  public void setRootExtendsClass(String JavaDoc newRootExtendsClass)
3167  {
3168    String JavaDoc oldRootExtendsClass = rootExtendsClass;
3169    rootExtendsClass = newRootExtendsClass;
3170    if (eNotificationRequired())
3171      eNotify(new ENotificationImpl(this, Notification.SET, GenModelPackage.GEN_MODEL__ROOT_EXTENDS_CLASS, oldRootExtendsClass, rootExtendsClass));
3172  }
3173
3174  /**
3175   * <!-- begin-user-doc -->
3176   * <!-- end-user-doc -->
3177   * @generated
3178   */

3179  public String JavaDoc getRootImplementsInterface()
3180  {
3181    return rootImplementsInterface;
3182  }
3183
3184  protected GenClass rootImplementsInterfaceGenClass;
3185
3186  public GenClass getRootImplementsInterfaceGenClass()
3187  {
3188    if (rootImplementsInterfaceGenClass == null)
3189    {
3190      for (Iterator JavaDoc i = getAllGenUsedAndStaticGenPackagesWithClassifiers().iterator(); i.hasNext(); )
3191      {
3192        GenPackage genPackage = (GenPackage)i.next();
3193        for (Iterator JavaDoc j = genPackage.getGenClasses().iterator(); j.hasNext(); )
3194        {
3195          GenClass genClass = (GenClass)j.next();
3196          if (genClass.getQualifiedInterfaceName().equals(rootImplementsInterface))
3197          {
3198            return rootImplementsInterfaceGenClass = genClass;
3199          }
3200        }
3201      }
3202    }
3203
3204    return rootImplementsInterfaceGenClass;
3205  }
3206
3207  /**
3208   * <!-- begin-user-doc -->
3209   * <!-- end-user-doc -->
3210   * @generated
3211   */

3212  public void setRootImplementsInterfaceGen(String JavaDoc newRootImplementsInterface)
3213  {
3214    String JavaDoc oldRootImplementsInterface = rootImplementsInterface;
3215    rootImplementsInterface = newRootImplementsInterface;
3216    if (eNotificationRequired())
3217      eNotify(new ENotificationImpl(this, Notification.SET, GenModelPackage.GEN_MODEL__ROOT_IMPLEMENTS_INTERFACE, oldRootImplementsInterface, rootImplementsInterface));
3218  }
3219
3220  public void setRootImplementsInterface(String JavaDoc newRootImplementsInterface)
3221  {
3222    setRootImplementsInterfaceGen(newRootImplementsInterface);
3223    rootImplementsInterfaceGenClass = null;
3224  }
3225
3226  public List JavaDoc getEffectiveModelPluginVariables()
3227  {
3228    return getModelPluginVariables();
3229  }
3230
3231  public List JavaDoc getEffectiveModelPluginIDs()
3232  {
3233    List JavaDoc result = new ArrayList JavaDoc(getModelPluginVariables());
3234    for (ListIterator JavaDoc i = result.listIterator(); i.hasNext(); )
3235    {
3236      Object JavaDoc item = i.next();
3237      if (item instanceof String JavaDoc)
3238      {
3239        String JavaDoc variable = (String JavaDoc)item;
3240        int index = variable.indexOf("=");
3241        if (index != -1)
3242        {
3243          i.set(variable.substring(index + 1));
3244        }
3245      }
3246      else
3247      {
3248        i.remove();
3249      }
3250    }
3251
3252    return result;
3253  }
3254
3255  /**
3256   * <!-- begin-user-doc -->
3257   * <!-- end-user-doc -->
3258   * @generated
3259   */

3260  public boolean isSuppressEMFTypes()
3261  {
3262    return suppressEMFTypes;
3263  }
3264
3265  /**
3266   * <!-- begin-user-doc -->
3267   * <!-- end-user-doc -->
3268   * @generated
3269   */

3270  public void setSuppressEMFTypes(boolean newSuppressEMFTypes)
3271  {
3272    boolean oldSuppressEMFTypes = suppressEMFTypes;
3273    suppressEMFTypes = newSuppressEMFTypes;
3274    if (eNotificationRequired())
3275      eNotify(new ENotificationImpl(this, Notification.SET, GenModelPackage.GEN_MODEL__SUPPRESS_EMF_TYPES, oldSuppressEMFTypes, suppressEMFTypes));
3276  }
3277
3278  /**
3279   * <!-- begin-user-doc -->
3280   * <!-- end-user-doc -->
3281   * @generated
3282   */

3283  public String JavaDoc getFeatureMapWrapperInterface()
3284  {
3285    return featureMapWrapperInterface;
3286  }
3287
3288  /**
3289   * <!-- begin-user-doc -->
3290   * <!-- end-user-doc -->
3291   * @generated
3292   */

3293  public void setFeatureMapWrapperInterface(String JavaDoc newFeatureMapWrapperInterface)
3294  {
3295    String JavaDoc oldFeatureMapWrapperInterface = featureMapWrapperInterface;
3296    featureMapWrapperInterface = newFeatureMapWrapperInterface;
3297    if (eNotificationRequired())
3298      eNotify(new ENotificationImpl(this, Notification.SET, GenModelPackage.GEN_MODEL__FEATURE_MAP_WRAPPER_INTERFACE, oldFeatureMapWrapperInterface, featureMapWrapperInterface));
3299  }
3300
3301  /**
3302   * <!-- begin-user-doc -->
3303   * <!-- end-user-doc -->
3304   * @generated
3305   */

3306  public String JavaDoc getFeatureMapWrapperInternalInterface()
3307  {
3308    return featureMapWrapperInternalInterface;
3309  }
3310
3311  /**
3312   * <!-- begin-user-doc -->
3313   * <!-- end-user-doc -->
3314   * @generated
3315   */

3316  public void setFeatureMapWrapperInternalInterface(String JavaDoc newFeatureMapWrapperInternalInterface)
3317  {
3318    String JavaDoc oldFeatureMapWrapperInternalInterface = featureMapWrapperInternalInterface;
3319    featureMapWrapperInternalInterface = newFeatureMapWrapperInternalInterface;
3320    if (eNotificationRequired())
3321      eNotify(new ENotificationImpl(this, Notification.SET, GenModelPackage.GEN_MODEL__FEATURE_MAP_WRAPPER_INTERNAL_INTERFACE, oldFeatureMapWrapperInternalInterface, featureMapWrapperInternalInterface));
3322  }
3323
3324  /**
3325   * <!-- begin-user-doc -->
3326   * <!-- end-user-doc -->
3327   * @generated
3328   */

3329  public String JavaDoc getFeatureMapWrapperClass()
3330  {
3331    return featureMapWrapperClass;
3332  }
3333
3334  /**
3335   * <!-- begin-user-doc -->
3336   * <!-- end-user-doc -->
3337   * @generated
3338   */

3339  public void setFeatureMapWrapperClass(String JavaDoc newFeatureMapWrapperClass)
3340  {
3341    String JavaDoc oldFeatureMapWrapperClass = featureMapWrapperClass;
3342    featureMapWrapperClass = newFeatureMapWrapperClass;
3343    if (eNotificationRequired())
3344      eNotify(new ENotificationImpl(this, Notification.SET, GenModelPackage.GEN_MODEL__FEATURE_MAP_WRAPPER_CLASS, oldFeatureMapWrapperClass, featureMapWrapperClass));
3345  }
3346
3347  /**
3348   * <!-- begin-user-doc -->
3349   * <!-- end-user-doc -->
3350   * @generated
3351   */

3352  public boolean isRuntimeCompatibility()
3353  {
3354    return runtimeCompatibility;
3355  }
3356
3357  public boolean needsRuntimeCompatibility()
3358  {
3359    return isRuntimeCompatibility() && !isRichClientPlatform();
3360  }
3361
3362  /**
3363   * <!-- begin-user-doc -->
3364   * <!-- end-user-doc -->
3365   * @generated
3366   */

3367  public void setRuntimeCompatibility(boolean newRuntimeCompatibility)
3368  {
3369    boolean oldRuntimeCompatibility = runtimeCompatibility;
3370    runtimeCompatibility = newRuntimeCompatibility;
3371    if (eNotificationRequired())
3372      eNotify(new ENotificationImpl(this, Notification.SET, GenModelPackage.GEN_MODEL__RUNTIME_COMPATIBILITY, oldRuntimeCompatibility, runtimeCompatibility));
3373  }
3374
3375  /**
3376   * <!-- begin-user-doc -->
3377   * <!-- end-user-doc -->
3378   * @generated
3379   */

3380  public boolean isRichClientPlatform()
3381  {
3382    return richClientPlatform;
3383  }
3384
3385  /**
3386   * <!-- begin-user-doc -->
3387   * <!-- end-user-doc -->
3388   * @generated
3389   */

3390  public void setRichClientPlatform(boolean newRichClientPlatform)
3391  {
3392    boolean oldRichClientPlatform = richClientPlatform;
3393    richClientPlatform = newRichClientPlatform;
3394    if (eNotificationRequired())
3395      eNotify(new ENotificationImpl(this, Notification.SET, GenModelPackage.GEN_MODEL__RICH_CLIENT_PLATFORM, oldRichClientPlatform, richClientPlatform));
3396  }
3397
3398  /**
3399   * <!-- begin-user-doc -->
3400   * <!-- end-user-doc -->
3401   * @generated
3402   */

3403  public boolean isReflectiveDelegation()
3404  {
3405    return reflectiveDelegation;
3406  }
3407
3408  /**
3409   * <!-- begin-user-doc -->
3410   * <!-- end-user-doc -->
3411   * @generated
3412   */

3413  public void setReflectiveDelegation(boolean newReflectiveDelegation)
3414  {
3415    boolean oldReflectiveDelegation = reflectiveDelegation;
3416    reflectiveDelegation = newReflectiveDelegation;
3417    if (eNotificationRequired())
3418      eNotify(new ENotificationImpl(this, Notification.SET, GenModelPackage.GEN_MODEL__REFLECTIVE_DELEGATION, oldReflectiveDelegation, reflectiveDelegation));
3419  }
3420
3421  /**
3422   * <!-- begin-user-doc -->
3423   * <!-- end-user-doc -->
3424   * @generated
3425   */

3426  public boolean isCodeFormatting()
3427  {
3428    return codeFormatting;
3429  }
3430
3431  /**
3432   * <!-- begin-user-doc -->
3433   * <!-- end-user-doc -->
3434   * @generated
3435   */

3436  public void setCodeFormatting(boolean newCodeFormatting)
3437  {
3438    boolean oldCodeFormatting = codeFormatting;
3439    codeFormatting = newCodeFormatting;
3440    if (eNotificationRequired())
3441      eNotify(new ENotificationImpl(this, Notification.SET, GenModelPackage.GEN_MODEL__CODE_FORMATTING, oldCodeFormatting, codeFormatting));
3442  }
3443
3444  public String JavaDoc getTestsDirectory()
3445  {
3446    return getPluginDirectory(isSetTestsDirectory(), getTestsDirectoryGen(), ".tests/");
3447  }
3448
3449  /**
3450   * <!-- begin-user-doc -->
3451   * <!-- end-user-doc -->
3452   * @generated
3453   */

3454  public String JavaDoc getTestsDirectoryGen()
3455  {
3456    return testsDirectory;
3457  }
3458
3459  /**
3460   * <!-- begin-user-doc -->
3461   * <!-- end-user-doc -->
3462   * @generated
3463   */

3464  public void setTestsDirectory(String JavaDoc newTestsDirectory)
3465  {
3466    String JavaDoc oldTestsDirectory = testsDirectory;
3467    testsDirectory = newTestsDirectory;
3468    boolean oldTestsDirectoryESet = testsDirectoryESet;
3469    testsDirectoryESet = true;
3470    if (eNotificationRequired())
3471      eNotify(new ENotificationImpl(this, Notification.SET, GenModelPackage.GEN_MODEL__TESTS_DIRECTORY, oldTestsDirectory, testsDirectory, !oldTestsDirectoryESet));
3472  }
3473
3474  /**
3475   * <!-- begin-user-doc -->
3476   * <!-- end-user-doc -->
3477   * @generated
3478   */

3479  public void unsetTestsDirectory()
3480  {
3481    String JavaDoc oldTestsDirectory = testsDirectory;
3482    boolean oldTestsDirectoryESet = testsDirectoryESet;
3483    testsDirectory = TESTS_DIRECTORY_EDEFAULT;
3484    testsDirectoryESet = false;
3485    if (eNotificationRequired())
3486      eNotify(new ENotificationImpl(this, Notification.UNSET, GenModelPackage.GEN_MODEL__TESTS_DIRECTORY, oldTestsDirectory, TESTS_DIRECTORY_EDEFAULT, oldTestsDirectoryESet));
3487  }
3488
3489  /**
3490   * <!-- begin-user-doc -->
3491   * <!-- end-user-doc -->
3492   * @generated
3493   */

3494  public boolean isSetTestsDirectory()
3495  {
3496    return testsDirectoryESet;
3497  }
3498
3499  public String JavaDoc getTestSuiteClass()
3500  {
3501    String JavaDoc suffix = GenPackageImpl.TESTS_PACKAGE_SUFFIX_EDEFAULT;
3502    GenPackage genPackage = getMainGenPackage();
3503    if (genPackage != null)
3504    {
3505      suffix = genPackage.getTestsPackageSuffix();
3506    }
3507    return getPluginClass(isSetTestSuiteClass(), getTestSuiteClassGen(), suffix, "AllTests");
3508  }
3509
3510  /**
3511   * <!-- begin-user-doc -->
3512   * <!-- end-user-doc -->
3513   * @generated
3514   */

3515  public String JavaDoc getTestSuiteClassGen()
3516  {
3517    return testSuiteClass;
3518  }
3519
3520  /**
3521   * <!-- begin-user-doc -->
3522   * <!-- end-user-doc -->
3523   * @generated
3524   */

3525  public void setTestSuiteClass(String JavaDoc newTestSuiteClass)
3526  {
3527    String JavaDoc oldTestSuiteClass = testSuiteClass;
3528    testSuiteClass = newTestSuiteClass;
3529    boolean oldTestSuiteClassESet = testSuiteClassESet;
3530    testSuiteClassESet = true;
3531    if (eNotificationRequired())
3532      eNotify(new ENotificationImpl(this, Notification.SET, GenModelPackage.GEN_MODEL__TEST_SUITE_CLASS, oldTestSuiteClass, testSuiteClass, !oldTestSuiteClassESet));
3533  }
3534
3535  /**
3536   * <!-- begin-user-doc -->
3537   * <!-- end-user-doc -->
3538   * @generated
3539   */

3540  public void unsetTestSuiteClass()
3541  {
3542    String JavaDoc oldTestSuiteClass = testSuiteClass;
3543    boolean oldTestSuiteClassESet = testSuiteClassESet;
3544    testSuiteClass = TEST_SUITE_CLASS_EDEFAULT;
3545    testSuiteClassESet = false;
3546    if (eNotificationRequired())
3547      eNotify(new ENotificationImpl(this, Notification.UNSET, GenModelPackage.GEN_MODEL__TEST_SUITE_CLASS, oldTestSuiteClass, TEST_SUITE_CLASS_EDEFAULT, oldTestSuiteClassESet));
3548  }
3549
3550  /**
3551   * <!-- begin-user-doc -->
3552   * <!-- end-user-doc -->
3553   * @generated
3554   */

3555  public boolean isSetTestSuiteClass()
3556  {
3557    return testSuiteClassESet;
3558  }
3559
3560  /**
3561   * <!-- begin-user-doc -->
3562   * <!-- end-user-doc -->
3563   * @generated
3564   */

3565  public String JavaDoc getBooleanFlagsField()
3566  {
3567    return booleanFlagsField;
3568  }
3569
3570  /**
3571   * <!-- begin-user-doc -->
3572   * <!-- end-user-doc -->
3573   * @generated
3574   */

3575  public void setBooleanFlagsField(String JavaDoc newBooleanFlagsField)
3576  {
3577    String JavaDoc oldBooleanFlagsField = booleanFlagsField;
3578    booleanFlagsField = newBooleanFlagsField;
3579    if (eNotificationRequired())
3580      eNotify(new ENotificationImpl(this, Notification.SET, GenModelPackage.GEN_MODEL__BOOLEAN_FLAGS_FIELD, oldBooleanFlagsField, booleanFlagsField));
3581  }
3582
3583  /**
3584   * <!-- begin-user-doc -->
3585   * <!-- end-user-doc -->
3586   * @generated
3587   */

3588  public int getBooleanFlagsReservedBits()
3589  {
3590    return booleanFlagsReservedBits;
3591  }
3592
3593  /**
3594   * <!-- begin-user-doc -->
3595   * <!-- end-user-doc -->
3596   * @generated
3597   */

3598  public void setBooleanFlagsReservedBits(int newBooleanFlagsReservedBits)
3599  {
3600    int oldBooleanFlagsReservedBits = booleanFlagsReservedBits;
3601    booleanFlagsReservedBits = newBooleanFlagsReservedBits;
3602    if (eNotificationRequired())
3603      eNotify(new ENotificationImpl(this, Notification.SET, GenModelPackage.GEN_MODEL__BOOLEAN_FLAGS_RESERVED_BITS, oldBooleanFlagsReservedBits, booleanFlagsReservedBits));
3604  }
3605
3606  /**
3607   * <!-- begin-user-doc -->
3608   * <!-- end-user-doc -->
3609   * @generated
3610   */

3611  public String JavaDoc getImporterID()
3612  {
3613    return importerID;
3614  }
3615
3616  /**
3617   * <!-- begin-user-doc -->
3618   * <!-- end-user-doc -->
3619   * @generated
3620   */

3621  public void setImporterID(String JavaDoc newImporterID)
3622  {
3623    String JavaDoc oldImporterID = importerID;
3624    importerID = newImporterID;
3625    if (eNotificationRequired())
3626      eNotify(new ENotificationImpl(this, Notification.SET, GenModelPackage.GEN_MODEL__IMPORTER_ID, oldImporterID, importerID));
3627  }
3628
3629  /**
3630   * <!-- begin-user-doc -->
3631   * <!-- end-user-doc -->
3632   * @generated
3633   */

3634  public boolean isBundleManifest()
3635  {
3636    return bundleManifest;
3637  }
3638
3639  /**
3640   * <!-- begin-user-doc -->
3641   * <!-- end-user-doc -->
3642   * @generated
3643   */

3644  public void setBundleManifest(boolean newBundleManifest)
3645  {
3646    boolean oldBundleManifest = bundleManifest;
3647    bundleManifest = newBundleManifest;
3648    if (eNotificationRequired())
3649      eNotify(new ENotificationImpl(this, Notification.SET, GenModelPackage.GEN_MODEL__BUNDLE_MANIFEST, oldBundleManifest, bundleManifest));
3650  }
3651
3652  /**
3653   * <!-- begin-user-doc -->
3654   * <!-- end-user-doc -->
3655   * @generated
3656   */

3657  public EList getGenPackages()
3658  {
3659    if (genPackages == null)
3660    {
3661      genPackages = new EObjectContainmentWithInverseEList(GenPackage.class, this, GenModelPackage.GEN_MODEL__GEN_PACKAGES, GenModelPackage.GEN_PACKAGE__GEN_MODEL);
3662    }
3663    return genPackages;
3664  }
3665
3666  public EList getStaticGenPackages()
3667  {
3668    if (staticGenPackages == null)
3669    {
3670      staticGenPackages = new UniqueEList();
3671      LOOP:
3672      for (Iterator JavaDoc i = getStaticPackages().iterator(); i.hasNext(); )
3673      {
3674        String JavaDoc nsURI = (String JavaDoc)i.next();
3675        for (Iterator JavaDoc j = getStaticGenPackages().iterator(); j.hasNext(); )
3676        {
3677          GenPackage staticGenPackage = (GenPackage)j.next();
3678          if (staticGenPackage.getNSURI().equals(nsURI))
3679          {
3680            continue LOOP;
3681          }
3682        }
3683        EPackage staticEPackage = eResource().getResourceSet().getPackageRegistry().getEPackage(nsURI);
3684        if (staticEPackage != null)
3685        {
3686          GenModel genModel = getGenModel().createGenModel();
3687          GenPackage staticGenPackage = getGenModel().createGenPackage();
3688          staticGenPackages.add(staticGenPackage);
3689          genModel.getGenPackages().add(staticGenPackage);
3690          staticGenPackage.initialize(staticEPackage);
3691        }
3692      }
3693    }
3694    return staticGenPackages;
3695  }
3696
3697  /**
3698   * <!-- begin-user-doc -->
3699   * <!-- end-user-doc -->
3700   * @generated
3701   */

3702  public EList getUsedGenPackages()
3703  {
3704    if (usedGenPackages == null)
3705    {
3706      usedGenPackages = new EObjectResolvingEList(GenPackage.class, this, GenModelPackage.GEN_MODEL__USED_GEN_PACKAGES);
3707    }
3708    return usedGenPackages;
3709  }
3710
3711  /**
3712   * <!-- begin-user-doc -->
3713   * <!-- end-user-doc -->
3714   * @generated
3715   */

3716  public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, Class JavaDoc baseClass, NotificationChain msgs)
3717  {
3718    if (featureID >= 0)
3719    {
3720      switch (eDerivedStructuralFeatureID(featureID, baseClass))
3721      {
3722        case GenModelPackage.GEN_MODEL__GEN_PACKAGES:
3723          return ((InternalEList)getGenPackages()).basicAdd(otherEnd, msgs);
3724        default:
3725          return eDynamicInverseAdd(otherEnd, featureID, baseClass, msgs);
3726      }
3727    }
3728    if (eContainer != null)
3729      msgs = eBasicRemoveFromContainer(msgs);
3730    return eBasicSetContainer(otherEnd, featureID, msgs);
3731  }
3732
3733  /**
3734   * <!-- begin-user-doc -->
3735   * <!-- end-user-doc -->
3736   * @generated
3737   */

3738  public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, Class JavaDoc baseClass, NotificationChain msgs)
3739  {
3740    if (featureID >= 0)
3741    {
3742      switch (eDerivedStructuralFeatureID(featureID, baseClass))
3743      {
3744        case GenModelPackage.GEN_MODEL__GEN_PACKAGES:
3745          return ((InternalEList)getGenPackages()).basicRemove(otherEnd, msgs);
3746        default:
3747          return eDynamicInverseRemove(otherEnd, featureID, baseClass, msgs);
3748      }
3749    }
3750    return eBasicSetContainer(null, featureID, msgs);
3751  }
3752
3753  /**
3754   * <!-- begin-user-doc -->
3755   * <!-- end-user-doc -->
3756   * @generated
3757   */

3758  public Object JavaDoc eGet(EStructuralFeature eFeature, boolean resolve)
3759  {
3760    switch (eDerivedStructuralFeatureID(eFeature))
3761    {
3762      case GenModelPackage.GEN_MODEL__COPYRIGHT_TEXT:
3763        return getCopyrightText();
3764      case GenModelPackage.GEN_MODEL__MODEL_DIRECTORY:
3765        return getModelDirectory();
3766      case GenModelPackage.GEN_MODEL__CREATION_COMMANDS:
3767        return isCreationCommands() ? Boolean.TRUE : Boolean.FALSE;
3768      case GenModelPackage.GEN_MODEL__CREATION_ICONS:
3769        return isCreationIcons() ? Boolean.TRUE : Boolean.FALSE;
3770      case GenModelPackage.GEN_MODEL__EDIT_DIRECTORY:
3771        return getEditDirectory();
3772      case GenModelPackage.GEN_MODEL__EDITOR_DIRECTORY:
3773        return getEditorDirectory();
3774      case GenModelPackage.GEN_MODEL__MODEL_PLUGIN_ID:
3775        return getModelPluginID();
3776      case GenModelPackage.GEN_MODEL__TEMPLATE_DIRECTORY:
3777        return getTemplateDirectory();
3778      case GenModelPackage.GEN_MODEL__RUNTIME_JAR:
3779        return isRuntimeJar() ? Boolean.TRUE : Boolean.FALSE;
3780      case GenModelPackage.GEN_MODEL__FOREIGN_MODEL:
3781        return getForeignModel();
3782      case GenModelPackage.GEN_MODEL__DYNAMIC_TEMPLATES:
3783        return isDynamicTemplates() ? Boolean.TRUE : Boolean.FALSE;
3784      case GenModelPackage.GEN_MODEL__REDIRECTION:
3785        return getRedirection();
3786      case GenModelPackage.GEN_MODEL__FORCE_OVERWRITE:
3787        return isForceOverwrite() ? Boolean.TRUE : Boolean.FALSE;
3788      case GenModelPackage.GEN_MODEL__NON_EXTERNALIZED_STRING_TAG:
3789        return getNonExternalizedStringTag();
3790      case GenModelPackage.GEN_MODEL__MODEL_NAME:
3791        return getModelName();
3792      case GenModelPackage.GEN_MODEL__MODEL_PLUGIN_CLASS:
3793        return getModelPluginClass();
3794      case GenModelPackage.GEN_MODEL__EDIT_PLUGIN_CLASS:
3795        return getEditPluginClass();
3796      case GenModelPackage.GEN_MODEL__EDITOR_PLUGIN_CLASS:
3797        return getEditorPluginClass();
3798      case GenModelPackage.GEN_MODEL__UPDATE_CLASSPATH:
3799        return isUpdateClasspath() ? Boolean.TRUE : Boolean.FALSE;
3800      case GenModelPackage.GEN_MODEL__GENERATE_SCHEMA:
3801        return isGenerateSchema() ? Boolean.TRUE : Boolean.FALSE;
3802      case GenModelPackage.GEN_MODEL__NON_NLS_MARKERS:
3803        return isNonNLSMarkers() ? Boolean.TRUE : Boolean.FALSE;
3804      case GenModelPackage.GEN_MODEL__STATIC_PACKAGES:
3805        return getStaticPackages();
3806      case GenModelPackage.GEN_MODEL__MODEL_PLUGIN_VARIABLES:
3807        return getModelPluginVariables();
3808      case GenModelPackage.GEN_MODEL__ROOT_EXTENDS_INTERFACE:
3809        return getRootExtendsInterface();
3810      case GenModelPackage.GEN_MODEL__ROOT_EXTENDS_CLASS:
3811        return getRootExtendsClass();
3812      case GenModelPackage.GEN_MODEL__ROOT_IMPLEMENTS_INTERFACE:
3813        return getRootImplementsInterface();
3814      case GenModelPackage.GEN_MODEL__SUPPRESS_EMF_TYPES:
3815        return isSuppressEMFTypes() ? Boolean.TRUE : Boolean.FALSE;
3816      case GenModelPackage.GEN_MODEL__FEATURE_MAP_WRAPPER_INTERFACE:
3817        return getFeatureMapWrapperInterface();
3818      case GenModelPackage.GEN_MODEL__FEATURE_MAP_WRAPPER_INTERNAL_INTERFACE:
3819        return getFeatureMapWrapperInternalInterface();
3820      case GenModelPackage.GEN_MODEL__FEATURE_MAP_WRAPPER_CLASS:
3821        return getFeatureMapWrapperClass();
3822      case GenModelPackage.GEN_MODEL__RUNTIME_COMPATIBILITY:
3823        return isRuntimeCompatibility() ? Boolean.TRUE : Boolean.FALSE;
3824      case GenModelPackage.GEN_MODEL__RICH_CLIENT_PLATFORM:
3825        return isRichClientPlatform() ? Boolean.TRUE : Boolean.FALSE;
3826      case GenModelPackage.GEN_MODEL__REFLECTIVE_DELEGATION:
3827        return isReflectiveDelegation() ? Boolean.TRUE : Boolean.FALSE;
3828      case GenModelPackage.GEN_MODEL__CODE_FORMATTING:
3829        return isCodeFormatting() ? Boolean.TRUE : Boolean.FALSE;
3830      case GenModelPackage.GEN_MODEL__TESTS_DIRECTORY:
3831        return getTestsDirectory();
3832      case GenModelPackage.GEN_MODEL__TEST_SUITE_CLASS:
3833        return getTestSuiteClass();
3834      case GenModelPackage.GEN_MODEL__BOOLEAN_FLAGS_FIELD:
3835        return getBooleanFlagsField();
3836      case GenModelPackage.GEN_MODEL__BOOLEAN_FLAGS_RESERVED_BITS:
3837        return new Integer JavaDoc(getBooleanFlagsReservedBits());
3838      case GenModelPackage.GEN_MODEL__IMPORTER_ID:
3839        return getImporterID();
3840      case GenModelPackage.GEN_MODEL__BUNDLE_MANIFEST:
3841        return isBundleManifest() ? Boolean.TRUE : Boolean.FALSE;
3842      case GenModelPackage.GEN_MODEL__GEN_PACKAGES:
3843        return getGenPackages();
3844      case GenModelPackage.GEN_MODEL__USED_GEN_PACKAGES:
3845        return getUsedGenPackages();
3846    }
3847    return eDynamicGet(eFeature, resolve);
3848  }
3849
3850  /**
3851   * <!-- begin-user-doc -->
3852   * <!-- end-user-doc -->
3853   * @generated
3854   */

3855  public boolean eIsSet(EStructuralFeature eFeature)
3856  {
3857    switch (eDerivedStructuralFeatureID(eFeature))
3858    {
3859      case GenModelPackage.GEN_MODEL__COPYRIGHT_TEXT:
3860        return COPYRIGHT_TEXT_EDEFAULT == null ? copyrightText != null : !COPYRIGHT_TEXT_EDEFAULT.equals(copyrightText);
3861      case GenModelPackage.GEN_MODEL__MODEL_DIRECTORY:
3862        return MODEL_DIRECTORY_EDEFAULT == null ? modelDirectory != null : !MODEL_DIRECTORY_EDEFAULT.equals(modelDirectory);
3863      case GenModelPackage.GEN_MODEL__CREATION_COMMANDS:
3864        return creationCommands != CREATION_COMMANDS_EDEFAULT;
3865      case GenModelPackage.GEN_MODEL__CREATION_ICONS:
3866        return creationIcons != CREATION_ICONS_EDEFAULT;
3867      case GenModelPackage.GEN_MODEL__EDIT_DIRECTORY:
3868        return isSetEditDirectory();
3869      case GenModelPackage.GEN_MODEL__EDITOR_DIRECTORY:
3870        return isSetEditorDirectory();
3871      case GenModelPackage.GEN_MODEL__MODEL_PLUGIN_ID:
3872        return MODEL_PLUGIN_ID_EDEFAULT == null ? modelPluginID != null : !MODEL_PLUGIN_ID_EDEFAULT.equals(modelPluginID);
3873      case GenModelPackage.GEN_MODEL__TEMPLATE_DIRECTORY:
3874        return TEMPLATE_DIRECTORY_EDEFAULT == null ? templateDirectory != null : !TEMPLATE_DIRECTORY_EDEFAULT.equals(templateDirectory);
3875      case GenModelPackage.GEN_MODEL__RUNTIME_JAR:
3876        return runtimeJar != RUNTIME_JAR_EDEFAULT;
3877      case GenModelPackage.GEN_MODEL__FOREIGN_MODEL:
3878        return foreignModel != null && !foreignModel.isEmpty();
3879      case GenModelPackage.GEN_MODEL__DYNAMIC_TEMPLATES:
3880        return dynamicTemplates != DYNAMIC_TEMPLATES_EDEFAULT;
3881      case GenModelPackage.GEN_MODEL__REDIRECTION:
3882        return REDIRECTION_EDEFAULT == null ? redirection != null : !REDIRECTION_EDEFAULT.equals(redirection);
3883      case GenModelPackage.GEN_MODEL__FORCE_OVERWRITE:
3884        return forceOverwrite != FORCE_OVERWRITE_EDEFAULT;
3885      case GenModelPackage.GEN_MODEL__NON_EXTERNALIZED_STRING_TAG:
3886        return NON_EXTERNALIZED_STRING_TAG_EDEFAULT == null ? nonExternalizedStringTag != null : !NON_EXTERNALIZED_STRING_TAG_EDEFAULT.equals(nonExternalizedStringTag);
3887      case GenModelPackage.GEN_MODEL__MODEL_NAME:
3888        return MODEL_NAME_EDEFAULT == null ? modelName != null : !MODEL_NAME_EDEFAULT.equals(modelName);
3889      case GenModelPackage.GEN_MODEL__MODEL_PLUGIN_CLASS:
3890        return MODEL_PLUGIN_CLASS_EDEFAULT == null ? modelPluginClass != null : !MODEL_PLUGIN_CLASS_EDEFAULT.equals(modelPluginClass);
3891      case GenModelPackage.GEN_MODEL__EDIT_PLUGIN_CLASS:
3892        return isSetEditPluginClass();
3893      case GenModelPackage.GEN_MODEL__EDITOR_PLUGIN_CLASS:
3894        return isSetEditorPluginClass();
3895      case GenModelPackage.GEN_MODEL__UPDATE_CLASSPATH:
3896        return updateClasspath != UPDATE_CLASSPATH_EDEFAULT;
3897      case GenModelPackage.GEN_MODEL__GENERATE_SCHEMA:
3898        return generateSchema != GENERATE_SCHEMA_EDEFAULT;
3899      case GenModelPackage.GEN_MODEL__NON_NLS_MARKERS:
3900        return nonNLSMarkers != NON_NLS_MARKERS_EDEFAULT;
3901      case GenModelPackage.GEN_MODEL__STATIC_PACKAGES:
3902        return staticPackages != null && !staticPackages.isEmpty();
3903      case GenModelPackage.GEN_MODEL__MODEL_PLUGIN_VARIABLES:
3904        return modelPluginVariables != null && !modelPluginVariables.isEmpty();
3905      case GenModelPackage.GEN_MODEL__ROOT_EXTENDS_INTERFACE:
3906        return ROOT_EXTENDS_INTERFACE_EDEFAULT == null ? rootExtendsInterface != null : !ROOT_EXTENDS_INTERFACE_EDEFAULT.equals(rootExtendsInterface);
3907      case GenModelPackage.GEN_MODEL__ROOT_EXTENDS_CLASS:
3908        return ROOT_EXTENDS_CLASS_EDEFAULT == null ? rootExtendsClass != null : !ROOT_EXTENDS_CLASS_EDEFAULT.equals(rootExtendsClass);
3909      case GenModelPackage.GEN_MODEL__ROOT_IMPLEMENTS_INTERFACE:
3910        return ROOT_IMPLEMENTS_INTERFACE_EDEFAULT == null ? rootImplementsInterface != null : !ROOT_IMPLEMENTS_INTERFACE_EDEFAULT.equals(rootImplementsInterface);
3911      case GenModelPackage.GEN_MODEL__SUPPRESS_EMF_TYPES:
3912        return suppressEMFTypes != SUPPRESS_EMF_TYPES_EDEFAULT;
3913      case GenModelPackage.GEN_MODEL__FEATURE_MAP_WRAPPER_INTERFACE:
3914        return FEATURE_MAP_WRAPPER_INTERFACE_EDEFAULT == null ? featureMapWrapperInterface != null : !FEATURE_MAP_WRAPPER_INTERFACE_EDEFAULT.equals(featureMapWrapperInterface);
3915      case GenModelPackage.GEN_MODEL__FEATURE_MAP_WRAPPER_INTERNAL_INTERFACE:
3916        return FEATURE_MAP_WRAPPER_INTERNAL_INTERFACE_EDEFAULT == null ? featureMapWrapperInternalInterface != null : !FEATURE_MAP_WRAPPER_INTERNAL_INTERFACE_EDEFAULT.equals(featureMapWrapperInternalInterface);
3917      case GenModelPackage.GEN_MODEL__FEATURE_MAP_WRAPPER_CLASS:
3918        return FEATURE_MAP_WRAPPER_CLASS_EDEFAULT == null ? featureMapWrapperClass != null : !FEATURE_MAP_WRAPPER_CLASS_EDEFAULT.equals(featureMapWrapperClass);
3919      case GenModelPackage.GEN_MODEL__RUNTIME_COMPATIBILITY:
3920        return runtimeCompatibility != RUNTIME_COMPATIBILITY_EDEFAULT;
3921      case GenModelPackage.GEN_MODEL__RICH_CLIENT_PLATFORM:
3922        return richClientPlatform != RICH_CLIENT_PLATFORM_EDEFAULT;
3923      case GenModelPackage.GEN_MODEL__REFLECTIVE_DELEGATION:
3924        return reflectiveDelegation != REFLECTIVE_DELEGATION_EDEFAULT;
3925      case GenModelPackage.GEN_MODEL__CODE_FORMATTING:
3926        return codeFormatting != CODE_FORMATTING_EDEFAULT;
3927      case GenModelPackage.GEN_MODEL__TESTS_DIRECTORY:
3928        return isSetTestsDirectory();
3929      case GenModelPackage.GEN_MODEL__TEST_SUITE_CLASS:
3930        return isSetTestSuiteClass();
3931      case GenModelPackage.GEN_MODEL__BOOLEAN_FLAGS_FIELD:
3932        return BOOLEAN_FLAGS_FIELD_EDEFAULT == null ? booleanFlagsField != null : !BOOLEAN_FLAGS_FIELD_EDEFAULT.equals(booleanFlagsField);
3933      case GenModelPackage.GEN_MODEL__BOOLEAN_FLAGS_RESERVED_BITS:
3934        return booleanFlagsReservedBits != BOOLEAN_FLAGS_RESERVED_BITS_EDEFAULT;
3935      case GenModelPackage.GEN_MODEL__IMPORTER_ID:
3936        return IMPORTER_ID_EDEFAULT == null ? importerID != null : !IMPORTER_ID_EDEFAULT.equals(importerID);
3937      case GenModelPackage.GEN_MODEL__BUNDLE_MANIFEST:
3938        return bundleManifest != BUNDLE_MANIFEST_EDEFAULT;
3939      case GenModelPackage.GEN_MODEL__GEN_PACKAGES:
3940        return genPackages != null && !genPackages.isEmpty();
3941      case GenModelPackage.GEN_MODEL__USED_GEN_PACKAGES:
3942        return usedGenPackages != null && !usedGenPackages.isEmpty();
3943    }
3944    return eDynamicIsSet(eFeature);
3945  }
3946
3947  /**
3948   * <!-- begin-user-doc -->
3949   * <!-- end-user-doc -->
3950   * @generated
3951   */

3952  public void eSet(EStructuralFeature eFeature, Object JavaDoc newValue)
3953  {
3954    switch (eDerivedStructuralFeatureID(eFeature))
3955    {
3956      case GenModelPackage.GEN_MODEL__COPYRIGHT_TEXT:
3957        setCopyrightText((String JavaDoc)newValue);
3958        return;
3959      case GenModelPackage.GEN_MODEL__MODEL_DIRECTORY:
3960        setModelDirectory((String JavaDoc)newValue);
3961        return;
3962      case GenModelPackage.GEN_MODEL__CREATION_COMMANDS:
3963        setCreationCommands(((Boolean JavaDoc)newValue).booleanValue());
3964        return;
3965      case GenModelPackage.GEN_MODEL__CREATION_ICONS:
3966        setCreationIcons(((Boolean JavaDoc)newValue).booleanValue());
3967        return;
3968      case GenModelPackage.GEN_MODEL__EDIT_DIRECTORY:
3969        setEditDirectory((String JavaDoc)newValue);
3970        return;
3971      case GenModelPackage.GEN_MODEL__EDITOR_DIRECTORY:
3972        setEditorDirectory((String JavaDoc)newValue);
3973        return;
3974      case GenModelPackage.GEN_MODEL__MODEL_PLUGIN_ID:
3975        setModelPluginID((String JavaDoc)newValue);
3976        return;
3977      case GenModelPackage.GEN_MODEL__TEMPLATE_DIRECTORY:
3978        setTemplateDirectory((String JavaDoc)newValue);
3979        return;
3980      case GenModelPackage.GEN_MODEL__RUNTIME_JAR:
3981        setRuntimeJar(((Boolean JavaDoc)newValue).booleanValue());
3982        return;
3983      case GenModelPackage.GEN_MODEL__FOREIGN_MODEL:
3984        getForeignModel().clear();
3985        getForeignModel().addAll((Collection JavaDoc)newValue);
3986        return;
3987      case GenModelPackage.GEN_MODEL__DYNAMIC_TEMPLATES:
3988        setDynamicTemplates(((Boolean JavaDoc)newValue).booleanValue());
3989        return;
3990      case GenModelPackage.GEN_MODEL__REDIRECTION:
3991        setRedirection((String JavaDoc)newValue);
3992        return;
3993      case GenModelPackage.GEN_MODEL__FORCE_OVERWRITE:
3994        setForceOverwrite(((Boolean JavaDoc)newValue).booleanValue());
3995        return;
3996      case GenModelPackage.GEN_MODEL__NON_EXTERNALIZED_STRING_TAG:
3997        setNonExternalizedStringTag((String JavaDoc)newValue);
3998        return;
3999      case GenModelPackage.GEN_MODEL__MODEL_NAME:
4000        setModelName((String JavaDoc)newValue);
4001        return;
4002      case GenModelPackage.GEN_MODEL__MODEL_PLUGIN_CLASS:
4003        setModelPluginClass((String JavaDoc)newValue);
4004        return;
4005      case GenModelPackage.GEN_MODEL__EDIT_PLUGIN_CLASS:
4006        setEditPluginClass((String JavaDoc)newValue);
4007        return;
4008      case GenModelPackage.GEN_MODEL__EDITOR_PLUGIN_CLASS:
4009        setEditorPluginClass((String JavaDoc)newValue);
4010        return;
4011      case GenModelPackage.GEN_MODEL__UPDATE_CLASSPATH:
4012        setUpdateClasspath(((Boolean JavaDoc)newValue).booleanValue());
4013        return;
4014      case GenModelPackage.GEN_MODEL__GENERATE_SCHEMA:
4015        setGenerateSchema(((Boolean JavaDoc)newValue).booleanValue());
4016        return;
4017      case GenModelPackage.GEN_MODEL__NON_NLS_MARKERS:
4018        setNonNLSMarkers(((Boolean JavaDoc)newValue).booleanValue());
4019        return;
4020      case GenModelPackage.GEN_MODEL__STATIC_PACKAGES:
4021        getStaticPackages().clear();
4022        getStaticPackages().addAll((Collection JavaDoc)newValue);
4023        return;
4024      case GenModelPackage.GEN_MODEL__MODEL_PLUGIN_VARIABLES:
4025        getModelPluginVariables().clear();
4026        getModelPluginVariables().addAll((Collection JavaDoc)newValue);
4027        return;
4028      case GenModelPackage.GEN_MODEL__ROOT_EXTENDS_INTERFACE:
4029        setRootExtendsInterface((String JavaDoc)newValue);
4030        return;
4031      case GenModelPackage.GEN_MODEL__ROOT_EXTENDS_CLASS:
4032        setRootExtendsClass((String JavaDoc)newValue);
4033        return;
4034      case GenModelPackage.GEN_MODEL__ROOT_IMPLEMENTS_INTERFACE:
4035        setRootImplementsInterface((String JavaDoc)newValue);
4036        return;
4037      case GenModelPackage.GEN_MODEL__SUPPRESS_EMF_TYPES:
4038        setSuppressEMFTypes(((Boolean JavaDoc)newValue).booleanValue());
4039        return;
4040      case GenModelPackage.GEN_MODEL__FEATURE_MAP_WRAPPER_INTERFACE:
4041        setFeatureMapWrapperInterface((String JavaDoc)newValue);
4042        return;
4043      case GenModelPackage.GEN_MODEL__FEATURE_MAP_WRAPPER_INTERNAL_INTERFACE:
4044        setFeatureMapWrapperInternalInterface((String JavaDoc)newValue);
4045        return;
4046      case GenModelPackage.GEN_MODEL__FEATURE_MAP_WRAPPER_CLASS:
4047        setFeatureMapWrapperClass((String JavaDoc)newValue);
4048        return;
4049      case GenModelPackage.GEN_MODEL__RUNTIME_COMPATIBILITY:
4050        setRuntimeCompatibility(((Boolean JavaDoc)newValue).booleanValue());
4051        return;
4052      case GenModelPackage.GEN_MODEL__RICH_CLIENT_PLATFORM:
4053        setRichClientPlatform(((Boolean JavaDoc)newValue).booleanValue());
4054        return;
4055      case GenModelPackage.GEN_MODEL__REFLECTIVE_DELEGATION:
4056        setReflectiveDelegation(((Boolean JavaDoc)newValue).booleanValue());
4057        return;
4058      case GenModelPackage.GEN_MODEL__CODE_FORMATTING:
4059        setCodeFormatting(((Boolean JavaDoc)newValue).booleanValue());
4060        return;
4061      case GenModelPackage.GEN_MODEL__TESTS_DIRECTORY:
4062        setTestsDirectory((String JavaDoc)newValue);
4063        return;
4064      case GenModelPackage.GEN_MODEL__TEST_SUITE_CLASS:
4065        setTestSuiteClass((String JavaDoc)newValue);
4066        return;
4067      case GenModelPackage.GEN_MODEL__BOOLEAN_FLAGS_FIELD:
4068        setBooleanFlagsField((String JavaDoc)newValue);
4069        return;
4070      case GenModelPackage.GEN_MODEL__BOOLEAN_FLAGS_RESERVED_BITS:
4071        setBooleanFlagsReservedBits(((Integer JavaDoc)newValue).intValue());
4072        return;
4073      case GenModelPackage.GEN_MODEL__IMPORTER_ID:
4074        setImporterID((String JavaDoc)newValue);
4075        return;
4076      case GenModelPackage.GEN_MODEL__BUNDLE_MANIFEST:
4077        setBundleManifest(((Boolean JavaDoc)newValue).booleanValue());
4078        return;
4079      case GenModelPackage.GEN_MODEL__GEN_PACKAGES:
4080        getGenPackages().clear();
4081        getGenPackages().addAll((Collection JavaDoc)newValue);
4082        return;
4083      case GenModelPackage.GEN_MODEL__USED_GEN_PACKAGES:
4084        getUsedGenPackages().clear();
4085        getUsedGenPackages().addAll((Collection JavaDoc)newValue);
4086        return;
4087    }
4088    eDynamicSet(eFeature, newValue);
4089  }
4090
4091  /**
4092   * <!-- begin-user-doc -->
4093   * <!-- end-user-doc -->
4094   * @generated
4095   */

4096  public void eUnset(EStructuralFeature eFeature)
4097  {
4098    switch (eDerivedStructuralFeatureID(eFeature))
4099    {
4100      case GenModelPackage.GEN_MODEL__COPYRIGHT_TEXT:
4101        setCopyrightText(COPYRIGHT_TEXT_EDEFAULT);
4102        return;
4103      case GenModelPackage.GEN_MODEL__MODEL_DIRECTORY:
4104        setModelDirectory(MODEL_DIRECTORY_EDEFAULT);
4105        return;
4106      case GenModelPackage.GEN_MODEL__CREATION_COMMANDS:
4107        setCreationCommands(CREATION_COMMANDS_EDEFAULT);
4108        return;
4109      case GenModelPackage.GEN_MODEL__CREATION_ICONS:
4110        setCreationIcons(CREATION_ICONS_EDEFAULT);
4111        return;
4112      case GenModelPackage.GEN_MODEL__EDIT_DIRECTORY:
4113        unsetEditDirectory();
4114        return;
4115      case GenModelPackage.GEN_MODEL__EDITOR_DIRECTORY:
4116        unsetEditorDirectory();
4117        return;
4118      case GenModelPackage.GEN_MODEL__MODEL_PLUGIN_ID:
4119        setModelPluginID(MODEL_PLUGIN_ID_EDEFAULT);
4120        return;
4121      case GenModelPackage.GEN_MODEL__TEMPLATE_DIRECTORY:
4122        setTemplateDirectory(TEMPLATE_DIRECTORY_EDEFAULT);
4123        return;
4124      case GenModelPackage.GEN_MODEL__RUNTIME_JAR:
4125        setRuntimeJar(RUNTIME_JAR_EDEFAULT);
4126        return;
4127      case GenModelPackage.GEN_MODEL__FOREIGN_MODEL:
4128        getForeignModel().clear();
4129        return;
4130      case GenModelPackage.GEN_MODEL__DYNAMIC_TEMPLATES:
4131        setDynamicTemplates(DYNAMIC_TEMPLATES_EDEFAULT);
4132        return;
4133      case GenModelPackage.GEN_MODEL__REDIRECTION:
4134        setRedirection(REDIRECTION_EDEFAULT);
4135        return;
4136      case GenModelPackage.GEN_MODEL__FORCE_OVERWRITE:
4137        setForceOverwrite(FORCE_OVERWRITE_EDEFAULT);
4138        return;
4139      case GenModelPackage.GEN_MODEL__NON_EXTERNALIZED_STRING_TAG:
4140        setNonExternalizedStringTag(NON_EXTERNALIZED_STRING_TAG_EDEFAULT);
4141        return;
4142      case GenModelPackage.GEN_MODEL__MODEL_NAME:
4143        setModelName(MODEL_NAME_EDEFAULT);
4144        return;
4145      case GenModelPackage.GEN_MODEL__MODEL_PLUGIN_CLASS:
4146        setModelPluginClass(MODEL_PLUGIN_CLASS_EDEFAULT);
4147        return;
4148      case GenModelPackage.GEN_MODEL__EDIT_PLUGIN_CLASS:
4149        unsetEditPluginClass();
4150        return;
4151      case GenModelPackage.GEN_MODEL__EDITOR_PLUGIN_CLASS:
4152        unsetEditorPluginClass();
4153        return;
4154      case GenModelPackage.GEN_MODEL__UPDATE_CLASSPATH:
4155        setUpdateClasspath(UPDATE_CLASSPATH_EDEFAULT);
4156        return;
4157      case GenModelPackage.GEN_MODEL__GENERATE_SCHEMA:
4158        setGenerateSchema(GENERATE_SCHEMA_EDEFAULT);
4159        return;
4160      case GenModelPackage.GEN_MODEL__NON_NLS_MARKERS:
4161        setNonNLSMarkers(NON_NLS_MARKERS_EDEFAULT);
4162        return;
4163      case GenModelPackage.GEN_MODEL__STATIC_PACKAGES:
4164        getStaticPackages().clear();
4165        return;
4166      case GenModelPackage.GEN_MODEL__MODEL_PLUGIN_VARIABLES:
4167        getModelPluginVariables().clear();
4168        return;
4169      case GenModelPackage.GEN_MODEL__ROOT_EXTENDS_INTERFACE:
4170        setRootExtendsInterface(ROOT_EXTENDS_INTERFACE_EDEFAULT);
4171        return;
4172      case GenModelPackage.GEN_MODEL__ROOT_EXTENDS_CLASS:
4173        setRootExtendsClass(ROOT_EXTENDS_CLASS_EDEFAULT);
4174        return;
4175      case GenModelPackage.GEN_MODEL__ROOT_IMPLEMENTS_INTERFACE:
4176        setRootImplementsInterface(ROOT_IMPLEMENTS_INTERFACE_EDEFAULT);
4177        return;
4178      case GenModelPackage.GEN_MODEL__SUPPRESS_EMF_TYPES:
4179        setSuppressEMFTypes(SUPPRESS_EMF_TYPES_EDEFAULT);
4180        return;
4181      case GenModelPackage.GEN_MODEL__FEATURE_MAP_WRAPPER_INTERFACE:
4182        setFeatureMapWrapperInterface(FEATURE_MAP_WRAPPER_INTERFACE_EDEFAULT);
4183        return;
4184      case GenModelPackage.GEN_MODEL__FEATURE_MAP_WRAPPER_INTERNAL_INTERFACE:
4185        setFeatureMapWrapperInternalInterface(FEATURE_MAP_WRAPPER_INTERNAL_INTERFACE_EDEFAULT);
4186        return;
4187      case GenModelPackage.GEN_MODEL__FEATURE_MAP_WRAPPER_CLASS:
4188        setFeatureMapWrapperClass(FEATURE_MAP_WRAPPER_CLASS_EDEFAULT);
4189        return;
4190      case GenModelPackage.GEN_MODEL__RUNTIME_COMPATIBILITY:
4191        setRuntimeCompatibility(RUNTIME_COMPATIBILITY_EDEFAULT);
4192        return;
4193      case GenModelPackage.GEN_MODEL__RICH_CLIENT_PLATFORM:
4194        setRichClientPlatform(RICH_CLIENT_PLATFORM_EDEFAULT);
4195        return;
4196      case GenModelPackage.GEN_MODEL__REFLECTIVE_DELEGATION:
4197        setReflectiveDelegation(REFLECTIVE_DELEGATION_EDEFAULT);
4198        return;
4199      case GenModelPackage.GEN_MODEL__CODE_FORMATTING:
4200        setCodeFormatting(CODE_FORMATTING_EDEFAULT);
4201        return;
4202      case GenModelPackage.GEN_MODEL__TESTS_DIRECTORY:
4203        unsetTestsDirectory();
4204        return;
4205      case GenModelPackage.GEN_MODEL__TEST_SUITE_CLASS:
4206        unsetTestSuiteClass();
4207        return;
4208      case GenModelPackage.GEN_MODEL__BOOLEAN_FLAGS_FIELD:
4209        setBooleanFlagsField(BOOLEAN_FLAGS_FIELD_EDEFAULT);
4210        return;
4211      case GenModelPackage.GEN_MODEL__BOOLEAN_FLAGS_RESERVED_BITS:
4212        setBooleanFlagsReservedBits(BOOLEAN_FLAGS_RESERVED_BITS_EDEFAULT);
4213        return;
4214      case GenModelPackage.GEN_MODEL__IMPORTER_ID:
4215        setImporterID(IMPORTER_ID_EDEFAULT);
4216        return;
4217      case GenModelPackage.GEN_MODEL__BUNDLE_MANIFEST:
4218        setBundleManifest(BUNDLE_MANIFEST_EDEFAULT);
4219        return;
4220      case GenModelPackage.GEN_MODEL__GEN_PACKAGES:
4221        getGenPackages().clear();
4222        return;
4223      case GenModelPackage.GEN_MODEL__USED_GEN_PACKAGES:
4224        getUsedGenPackages().clear();
4225        return;
4226    }
4227    eDynamicUnset(eFeature);
4228  }
4229
4230  /**
4231   * <!-- begin-user-doc -->
4232   * <!-- end-user-doc -->
4233   * @generated
4234   */

4235  public String JavaDoc toString()
4236  {
4237    if (eIsProxy()) return super.toString();
4238
4239    StringBuffer JavaDoc result = new StringBuffer JavaDoc(super.toString());
4240    result.append(" (copyrightText: ");
4241    result.append(copyrightText);
4242    result.append(", modelDirectory: ");
4243    result.append(modelDirectory);
4244    result.append(", creationCommands: ");
4245    result.append(creationCommands);
4246    result.append(", creationIcons: ");
4247    result.append(creationIcons);
4248    result.append(", editDirectory: ");
4249    if (editDirectoryESet) result.append(editDirectory); else result.append("<unset>");
4250    result.append(", editorDirectory: ");
4251    if (editorDirectoryESet) result.append(editorDirectory); else result.append("<unset>");
4252    result.append(", modelPluginID: ");
4253    result.append(modelPluginID);
4254    result.append(", templateDirectory: ");
4255    result.append(templateDirectory);
4256    result.append(", runtimeJar: ");
4257    result.append(runtimeJar);
4258    result.append(", foreignModel: ");
4259    result.append(foreignModel);
4260    result.append(", dynamicTemplates: ");
4261    result.append(dynamicTemplates);
4262    result.append(", redirection: ");
4263    result.append(redirection);
4264    result.append(", forceOverwrite: ");
4265    result.append(forceOverwrite);
4266    result.append(", nonExternalizedStringTag: ");
4267    result.append(nonExternalizedStringTag);
4268    result.append(", modelName: ");
4269    result.append(modelName);
4270    result.append(", modelPluginClass: ");
4271    result.append(modelPluginClass);
4272    result.append(", editPluginClass: ");
4273    if (editPluginClassESet) result.append(editPluginClass); else result.append("<unset>");
4274    result.append(", editorPluginClass: ");
4275    if (editorPluginClassESet) result.append(editorPluginClass); else result.append("<unset>");
4276    result.append(", updateClasspath: ");
4277    result.append(updateClasspath);
4278    result.append(", generateSchema: ");
4279    result.append(generateSchema);
4280    result.append(", nonNLSMarkers: ");
4281    result.append(nonNLSMarkers);
4282    result.append(", staticPackages: ");
4283    result.append(staticPackages);
4284    result.append(", modelPluginVariables: ");
4285    result.append(modelPluginVariables);
4286    result.append(", rootExtendsInterface: ");
4287    result.append(rootExtendsInterface);
4288    result.append(", rootExtendsClass: ");
4289    result.append(rootExtendsClass);
4290    result.append(", rootImplementsInterface: ");
4291    result.append(rootImplementsInterface);
4292    result.append(", suppressEMFTypes: ");
4293    result.append(suppressEMFTypes);
4294    result.append(", featureMapWrapperInterface: ");
4295    result.append(featureMapWrapperInterface);
4296    result.append(", featureMapWrapperInternalInterface: ");
4297    result.append(featureMapWrapperInternalInterface);
4298    result.append(", featureMapWrapperClass: ");
4299    result.append(featureMapWrapperClass);
4300    result.append(", runtimeCompatibility: ");
4301    result.append(runtimeCompatibility);
4302    result.append(", richClientPlatform: ");
4303    result.append(richClientPlatform);
4304    result.append(", reflectiveDelegation: ");
4305    result.append(reflectiveDelegation);
4306    result.append(", codeFormatting: ");
4307    result.append(codeFormatting);
4308    result.append(", testsDirectory: ");
4309    if (testsDirectoryESet) result.append(testsDirectory); else result.append("<unset>");
4310    result.append(", testSuiteClass: ");
4311    if (testSuiteClassESet) result.append(testSuiteClass); else result.append("<unset>");
4312    result.append(", booleanFlagsField: ");
4313    result.append(booleanFlagsField);
4314    result.append(", booleanFlagsReservedBits: ");
4315    result.append(booleanFlagsReservedBits);
4316    result.append(", importerID: ");
4317    result.append(importerID);
4318    result.append(", bundleManifest: ");
4319    result.append(bundleManifest);
4320    result.append(')');
4321    return result.toString();
4322  }
4323
4324  static protected String JavaDoc getProjectPath(String JavaDoc path)
4325  {
4326    int beginIndex = path.startsWith("/") ? 1 : 0;
4327    int endIndex = path.indexOf("/", beginIndex);
4328    if (endIndex != -1)
4329    {
4330      return path.substring(0, endIndex);
4331    }
4332    else
4333    {
4334      return path;
4335    }
4336  }
4337
4338  public String JavaDoc getModelProjectDirectory()
4339  {
4340    return getProjectPath(getModelDirectory());
4341  }
4342
4343  public String JavaDoc getEditProjectDirectory()
4344  {
4345    return getProjectPath(getEditDirectory());
4346  }
4347
4348  public String JavaDoc getEditorProjectDirectory()
4349  {
4350    return getProjectPath(getEditorDirectory());
4351  }
4352
4353  public String JavaDoc getTestsProjectDirectory()
4354  {
4355    return getProjectPath(getTestsDirectory());
4356  }
4357
4358  public boolean sameModelEditProject()
4359  {
4360    return getModelProjectDirectory().equals(getEditProjectDirectory());
4361  }
4362
4363  public boolean sameEditEditorProject()
4364  {
4365    return getEditProjectDirectory().equals(getEditorProjectDirectory());
4366  }
4367
4368  public boolean sameModelEditorProject()
4369  {
4370    return getModelProjectDirectory().equals(getEditorProjectDirectory());
4371  }
4372
4373  public boolean sameModelTestsProject()
4374  {
4375    // Different than the Edit and Editor projects, this method is invoked while
4376
// generating the model plugin xml.
4377
return getTestsDirectory() == null ? false : getModelProjectDirectory().equals(getTestsProjectDirectory());
4378  }
4379
4380  public String JavaDoc getEditIconsDirectory()
4381  {
4382    return getEditProjectDirectory() + "/icons";
4383  }
4384
4385  public String JavaDoc getEditorIconsDirectory()
4386  {
4387    return getEditorProjectDirectory() + "/icons";
4388  }
4389
4390  public String JavaDoc getEditPluginID()
4391  {
4392    if (sameModelEditProject())
4393    {
4394      return getModelPluginID();
4395    }
4396    else
4397    {
4398      return getModelPluginID() + ".edit";
4399    }
4400  }
4401
4402  public String JavaDoc getEditorPluginID()
4403  {
4404    if (sameEditEditorProject())
4405    {
4406      return getEditPluginID();
4407    }
4408    else
4409    {
4410      return getModelPluginID() + ".editor";
4411    }
4412  }
4413
4414  public String JavaDoc getTestsPluginID()
4415  {
4416    if (sameModelTestsProject())
4417    {
4418      return getModelPluginID();
4419    }
4420    else
4421    {
4422      return getModelPluginID() + ".tests";
4423    }
4424  }
4425
4426  public boolean hasModelPluginClass()
4427  {
4428    return !sameModelEditProject() && !sameModelEditorProject() &&
4429      !isBlank(getModelPluginClass());
4430  }
4431
4432  protected String JavaDoc getModelPluginClassToUse()
4433  {
4434    String JavaDoc result = getModelPluginClass();
4435    if (isBlank(result) && sameModelEditProject())
4436    {
4437      result = getEditPluginClass();
4438    }
4439    if (isBlank(result) && sameModelEditorProject())
4440    {
4441      result = getEditorPluginClass();
4442    }
4443    return result;
4444  }
4445
4446  protected String JavaDoc getEditPluginClassToUse()
4447  {
4448    String JavaDoc result = null;
4449    if (sameModelEditProject())
4450    {
4451      result = getModelPluginClass();
4452    }
4453    if (isBlank(result))
4454    {
4455      result = getEditPluginClass();
4456    }
4457    if (isBlank(result) && sameEditEditorProject())
4458    {
4459      result = getEditorPluginClass();
4460    }
4461    return result;
4462  }
4463
4464  protected String JavaDoc getEditPluginDirectory()
4465  {
4466    String JavaDoc result = getEditDirectory();
4467    String JavaDoc plugin = null;
4468    if (sameModelEditProject())
4469    {
4470      plugin = getModelPluginClass();
4471      result = getModelDirectory();
4472    }
4473    if (isBlank(plugin))
4474    {
4475      plugin = getEditPluginClass();
4476      result = getEditDirectory();
4477    }
4478    if (isBlank(plugin) && sameEditEditorProject())
4479    {
4480      plugin = getEditorPluginClass();
4481      result = getEditorDirectory();
4482    }
4483    return result;
4484  }
4485
4486  protected String JavaDoc getEditorPluginClassToUse()
4487  {
4488    String JavaDoc result = null;
4489    if (sameModelEditorProject())
4490    {
4491      result = getModelPluginClass();
4492    }
4493    if (isBlank(result) && sameEditEditorProject())
4494    {
4495      result = getEditPluginClass();
4496    }
4497    if (isBlank(result))
4498    {
4499      result = getEditorPluginClass();
4500    }
4501    return result;
4502  }
4503
4504  protected String JavaDoc getEditorPluginDirectory()
4505  {
4506    String JavaDoc result = getEditorDirectory();
4507    String JavaDoc plugin = null;
4508    if (sameModelEditorProject())
4509    {
4510      plugin = getModelPluginClass();
4511      result = getModelDirectory();
4512    }
4513    if (isBlank(plugin) && sameEditEditorProject())
4514    {
4515      plugin = getEditPluginClass();
4516      result = getEditDirectory();
4517    }
4518    if (isBlank(plugin))
4519    {
4520      plugin = getEditorPluginClass();
4521      result = getEditorDirectory();
4522    }
4523    return result;
4524  }
4525  
4526  protected String JavaDoc getPluginClassName(String JavaDoc baseName, String JavaDoc defaultSuffix)
4527  {
4528    if (baseName == null)
4529    {
4530      String JavaDoc modelName = getModelName();
4531      baseName = (isBlank(modelName) ? "" : modelName) + defaultSuffix;
4532    }
4533    else
4534    {
4535      baseName = CodeGenUtil.getSimpleClassName(baseName);
4536    }
4537    return baseName;
4538  }
4539
4540  protected String JavaDoc getPluginPackageName(String JavaDoc baseName, String JavaDoc pluginID)
4541  {
4542    if (baseName == null)
4543    {
4544      baseName = createPackageName(pluginID);
4545    }
4546    else
4547    {
4548      int index = baseName.lastIndexOf(".");
4549      if (index == -1)
4550      {
4551        baseName = createPackageName(pluginID);
4552      }
4553      else
4554      {
4555        baseName = CodeGenUtil.getPackageName(baseName);
4556      }
4557    }
4558    return baseName;
4559  }
4560
4561  protected String JavaDoc createPackageName(String JavaDoc text)
4562  {
4563    return text != null ? text.toLowerCase() : "";
4564  }
4565
4566  public String JavaDoc getModelPluginPackageName()
4567  {
4568    return getPluginPackageName(getModelPluginClassToUse(), getModelPluginID());
4569  }
4570
4571  public String JavaDoc getModelPluginClassName()
4572  {
4573    return getPluginClassName(getModelPluginClassToUse(), "Plugin");
4574  }
4575  
4576  public String JavaDoc getQualifiedModelPluginClassName()
4577  {
4578    return getModelPluginPackageName() + "." + getModelPluginClassName();
4579  }
4580
4581  public String JavaDoc getEditPluginPackageName()
4582  {
4583    return getPluginPackageName(getEditPluginClassToUse(), getEditPluginID());
4584  }
4585  
4586  public String JavaDoc getEditPluginClassName()
4587  {
4588    return getPluginClassName(getEditPluginClassToUse(), "EditPlugin");
4589  }
4590
4591  public String JavaDoc getQualifiedEditPluginClassName()
4592  {
4593    return getEditPluginPackageName() + "." + getEditPluginClassName();
4594  }
4595
4596  public String JavaDoc getEditorPluginPackageName()
4597  {
4598    return getPluginPackageName(getEditorPluginClassToUse(), getEditorPluginID());
4599  }
4600
4601  public String JavaDoc getEditorPluginClassName()
4602  {
4603    return getPluginClassName(getEditorPluginClassToUse(), "EditorPlugin");
4604  }
4605
4606  public String JavaDoc getQualifiedEditorPluginClassName()
4607  {
4608    return getEditorPluginPackageName() + "." + getEditorPluginClassName();
4609  }
4610
4611  public String JavaDoc getQualifiedEditorAdvisorClassName()
4612  {
4613    return getEditorPluginPackageName() + "." + getEditorAdvisorClassName();
4614  }
4615  
4616  public String JavaDoc getEditorAdvisorClassName()
4617  {
4618    String JavaDoc modelName = getModelName();
4619    return (modelName != null ? getModelName() : "") + "EditorAdvisor";
4620  }
4621
4622  public String JavaDoc getTestSuitePackageName()
4623  {
4624    return getPluginPackageName(getTestSuiteClass(), getTestsPluginID());
4625  }
4626
4627  public String JavaDoc getTestSuiteClassName()
4628  {
4629    return getPluginClassName(getTestSuiteClass(), "AllTests");
4630  }
4631
4632  public String JavaDoc getQualifiedTestSuiteClassName()
4633  {
4634    return getTestSuitePackageName() + "." + getTestSuiteClassName();
4635  }
4636
4637  protected void getAllGenPackagesWithClassifiersHelper(List JavaDoc result, List JavaDoc genPackages)
4638  {
4639    for (Iterator JavaDoc i = genPackages.iterator(); i.hasNext(); )
4640    {
4641      GenPackage genPackage = (GenPackage)i.next();
4642      if (genPackage.hasClassifiers())
4643      {
4644        result.add(genPackage);
4645      }
4646      getAllGenPackagesWithClassifiersHelper(result, genPackage.getNestedGenPackages());
4647    }
4648  }
4649
4650  public List JavaDoc getAllGenPackagesWithClassifiers()
4651  {
4652    List JavaDoc result = new ArrayList JavaDoc();
4653    getAllGenPackagesWithClassifiersHelper(result, getGenPackages());
4654    return result;
4655  }
4656
4657  public List JavaDoc getAllUsedGenPackagesWithClassifiers()
4658  {
4659    List JavaDoc result = new ArrayList JavaDoc();
4660    getAllGenPackagesWithClassifiersHelper(result, getUsedGenPackages());
4661    return result;
4662  }
4663
4664  public List JavaDoc getAllGenAndUsedGenPackagesWithClassifiers()
4665  {
4666    List JavaDoc result = new ArrayList JavaDoc();
4667    getAllGenPackagesWithClassifiersHelper(result, getGenPackages());
4668    getAllGenPackagesWithClassifiersHelper(result, getUsedGenPackages());
4669    return result;
4670  }
4671
4672  public List JavaDoc getAllGenUsedAndStaticGenPackagesWithClassifiers()
4673  {
4674    List JavaDoc result = new ArrayList JavaDoc();
4675    getAllGenPackagesWithClassifiersHelper(result, getGenPackages());
4676    getAllGenPackagesWithClassifiersHelper(result, getUsedGenPackages());
4677    getAllGenPackagesWithClassifiersHelper(result, getStaticGenPackages());
4678    return result;
4679  }
4680  
4681  public List JavaDoc getModelQualifiedPackageNames()
4682  {
4683    EList packageNames = sameModelTestsProject() ?
4684      (EList)getTestsQualifiedPackageNames() :
4685      new UniqueEList();
4686      
4687    TreeIterator genPackagesIterator = new AbstractTreeIterator(getGenPackages(), false)
4688    {
4689      protected Iterator JavaDoc getChildren(Object JavaDoc object)
4690      {
4691        return object instanceof Collection JavaDoc ?
4692          ((Collection JavaDoc)object).iterator() :
4693          ((GenPackage)object).getNestedGenPackages().iterator();
4694      }
4695    };
4696    while(genPackagesIterator.hasNext())
4697    {
4698      GenPackage genPackage = (GenPackage)genPackagesIterator.next();
4699      addQualifiedModelPackageNames(packageNames, genPackage);
4700    }
4701    
4702    String JavaDoc pluginClassPackage = CodeGenUtil.getPackageName(getModelPluginClassToUse());
4703    if (!isBlank(pluginClassPackage))
4704    {
4705      packageNames.add(pluginClassPackage);
4706    }
4707    
4708    ECollections.sort(packageNames);
4709    return packageNames;
4710  }
4711  
4712  protected void addQualifiedModelPackageNames(List JavaDoc packageNames, GenPackage genPackage)
4713  {
4714    if (genPackage.hasClassifiers())
4715    {
4716      packageNames.add(genPackage.getInterfacePackageName());
4717      packageNames.add(genPackage.getClassPackageName());
4718      packageNames.add(genPackage.getUtilitiesPackageName());
4719    }
4720  }
4721
4722  public List JavaDoc getModelRequiredPlugins()
4723  {
4724    List JavaDoc result = new UniqueEList();
4725    result.add(needsRuntimeCompatibility() ? "org.eclipse.core.runtime.compatibility" : "org.eclipse.core.runtime");
4726    result.add("org.eclipse.emf.ecore");
4727    result.addAll(getEffectiveModelPluginIDs());
4728    for (Iterator JavaDoc i = getGenPackages().iterator(); i.hasNext(); )
4729    {
4730      GenPackage genPackage = (GenPackage)i.next();
4731      if (genPackage.getResource() != GenResourceKind.NONE_LITERAL || genPackage.isLoadingInitialization())
4732      {
4733        result.add("org.eclipse.emf.ecore.xmi");
4734        break;
4735      }
4736    }
4737    for (Iterator JavaDoc i = getUsedGenPackages().iterator(); i.hasNext(); )
4738    {
4739      GenPackage genPackage = (GenPackage)i.next();
4740      result.add(genPackage.getGenModel().getModelPluginID());
4741    }
4742
4743    if (sameModelTestsProject())
4744    {
4745      result.add("org.junit");
4746    }
4747
4748    return result;
4749  }
4750
4751  public List JavaDoc getEditQualifiedPackageNames()
4752  {
4753    EList packageNames = sameModelEditProject() ?
4754      (EList)getModelQualifiedPackageNames() :
4755      new UniqueEList();
4756
4757    TreeIterator genPackagesIterator = new AbstractTreeIterator(getGenPackages(), false)
4758    {
4759      protected Iterator JavaDoc getChildren(Object JavaDoc object)
4760      {
4761        return object instanceof Collection JavaDoc ?
4762          ((Collection JavaDoc)object).iterator() :
4763          ((GenPackage)object).getNestedGenPackages().iterator();
4764      }
4765    };
4766    while(genPackagesIterator.hasNext())
4767    {
4768      GenPackage genPackage = (GenPackage)genPackagesIterator.next();
4769      addQualifiedEditPackageNames(packageNames, genPackage);
4770    }
4771    
4772    String JavaDoc pluginClassPackage = CodeGenUtil.getPackageName(getEditPluginClassToUse());
4773    if (!isBlank(pluginClassPackage))
4774    {
4775      packageNames.add(pluginClassPackage);
4776    }
4777    
4778    ECollections.sort(packageNames);
4779    return packageNames;
4780  }
4781
4782  protected void addQualifiedEditPackageNames(List JavaDoc packageNames, GenPackage genPackage)
4783  {
4784    if (genPackage.hasClassifiers())
4785    {
4786      packageNames.add(genPackage.getProviderPackageName());
4787    }
4788  }
4789
4790  public List JavaDoc getEditRequiredPlugins()
4791  {
4792    List JavaDoc result = new UniqueEList();
4793    result.add(needsRuntimeCompatibility() ? "org.eclipse.core.runtime.compatibility" : "org.eclipse.core.runtime");
4794
4795    if (!sameModelEditProject())
4796    {
4797      for (Iterator JavaDoc i = getGenPackages().iterator(); i.hasNext(); )
4798      {
4799        GenPackage genPackage = (GenPackage)i.next();
4800        result.add(genPackage.getGenModel().getModelPluginID());
4801      }
4802    }
4803    else
4804    {
4805      result.addAll(getModelRequiredPlugins());
4806    }
4807    
4808    result.add("org.eclipse.emf.edit");
4809    
4810    for (Iterator JavaDoc i = getUsedGenPackages().iterator(); i.hasNext(); )
4811    {
4812      GenPackage genPackage = (GenPackage)i.next();
4813      GenModel genModel = genPackage.getGenModel();
4814      result.add(genModel.getModelPluginID());
4815      if (genModel.hasEditSupport())
4816      {
4817        result.add(genModel.getEditPluginID());
4818      }
4819    }
4820    return result;
4821  }
4822
4823  public List JavaDoc getEditorQualifiedPackageNames()
4824  {
4825    EList packageNames = sameModelEditorProject() || sameEditEditorProject() ?
4826      (EList)getEditQualifiedPackageNames() :
4827      new UniqueEList();
4828
4829    TreeIterator genPackagesIterator = new AbstractTreeIterator(getGenPackages(), false)
4830    {
4831      protected Iterator JavaDoc getChildren(Object JavaDoc object)
4832      {
4833        return object instanceof Collection JavaDoc ?
4834          ((Collection JavaDoc)object).iterator() :
4835          ((GenPackage)object).getNestedGenPackages().iterator();
4836      }
4837    };
4838    while(genPackagesIterator.hasNext())
4839    {
4840      GenPackage genPackage = (GenPackage)genPackagesIterator.next();
4841      addQualifiedEditorPackageNames(packageNames, genPackage);
4842    }
4843
4844    String JavaDoc pluginClassPackage = CodeGenUtil.getPackageName(getEditorPluginClassToUse());
4845    if (!isBlank(pluginClassPackage))
4846    {
4847      packageNames.add(pluginClassPackage);
4848    }
4849    
4850    ECollections.sort(packageNames);
4851    return packageNames;
4852  }
4853
4854  protected void addQualifiedEditorPackageNames(List JavaDoc packageNames, GenPackage genPackage)
4855  {
4856    if (genPackage.hasClassifiers() && genPackage.hasConcreteClasses())
4857    {
4858      packageNames.add(genPackage.getPresentationPackageName());
4859    }
4860  }
4861
4862  public List JavaDoc getEditorRequiredPlugins()
4863  {
4864    List JavaDoc result = new UniqueEList();
4865    result.add(needsRuntimeCompatibility() ? "org.eclipse.core.runtime.compatibility" : "org.eclipse.core.runtime");
4866    if (!isRichClientPlatform())
4867    {
4868      result.add("org.eclipse.core.resources");
4869    }
4870    
4871    if (!sameEditEditorProject())
4872    {
4873      for (Iterator JavaDoc i = getGenPackages().iterator(); i.hasNext(); )
4874      {
4875        GenPackage genPackage = (GenPackage)i.next();
4876        GenModel genModel = genPackage.getGenModel();
4877        if (genModel.hasEditSupport())
4878        {
4879          result.add(genModel.getEditPluginID());
4880        }
4881      }
4882    }
4883    else
4884    {
4885      result.addAll(getEditRequiredPlugins());
4886    }
4887    result.add("org.eclipse.emf.ecore.xmi");
4888    result.add("org.eclipse.emf.edit.ui");
4889    if (!isRichClientPlatform())
4890    {
4891      result.add("org.eclipse.ui.ide");
4892    }
4893    for (Iterator JavaDoc i = getUsedGenPackages().iterator(); i.hasNext(); )
4894    {
4895      GenPackage genPackage = (GenPackage)i.next();
4896      GenModel genModel = genPackage.getGenModel();
4897      if (genModel.hasEditSupport())
4898      {
4899        result.add(genModel.getEditPluginID());
4900      }
4901    }
4902    return result;
4903  }
4904
4905  public List JavaDoc getTestsQualifiedPackageNames()
4906  {
4907    EList packageNames = new UniqueEList();
4908
4909    TreeIterator genPackagesIterator = new AbstractTreeIterator(getGenPackages(), false)
4910    {
4911      protected Iterator JavaDoc getChildren(Object JavaDoc object)
4912      {
4913        return object instanceof Collection JavaDoc ?
4914          ((Collection JavaDoc)object).iterator() :
4915          ((GenPackage)object).getNestedGenPackages().iterator();
4916      }
4917    };
4918    while(genPackagesIterator.hasNext())
4919    {
4920      GenPackage genPackage = (GenPackage)genPackagesIterator.next();
4921      addQualifiedTestsPackageNames(packageNames, genPackage);
4922    }
4923
4924    String JavaDoc pluginClassPackage = CodeGenUtil.getPackageName(getTestSuiteClass());
4925    if (!isBlank(pluginClassPackage))
4926    {
4927      packageNames.add(pluginClassPackage);
4928    }
4929    
4930    ECollections.sort(packageNames);
4931    return packageNames;
4932  }
4933
4934  protected void addQualifiedTestsPackageNames(List JavaDoc packageNames, GenPackage genPackage)
4935  {
4936    if (genPackage.hasClassifiers())
4937    {
4938      packageNames.add(genPackage.getTestsPackageName());
4939    }
4940  }
4941
4942  public List JavaDoc getTestsRequiredPlugins()
4943  {
4944    List JavaDoc result = new UniqueEList();
4945    result.add(needsRuntimeCompatibility() ? "org.eclipse.core.runtime.compatibility" : "org.eclipse.core.runtime");
4946
4947    result.add(getModelPluginID());
4948    for (Iterator JavaDoc i = getUsedGenPackages().iterator(); i.hasNext();)
4949    {
4950      GenPackage genPackage = (GenPackage)i.next();
4951      GenModel genModel = genPackage.getGenModel();
4952      result.add(genModel.getModelPluginID());
4953    }
4954
4955    result.add("org.eclipse.emf.ecore.xmi");
4956
4957    result.add("org.junit");
4958
4959    return result;
4960  }
4961
4962  public List JavaDoc getEditResourceDelegateImportedPluginClassNames()
4963  {
4964    List JavaDoc result = new UniqueEList();
4965    for (Iterator JavaDoc i = getUsedGenPackages().iterator(); i.hasNext(); )
4966    {
4967      GenPackage genPackage = (GenPackage)i.next();
4968      GenModel genModel = genPackage.getGenModel();
4969      if (genModel.hasEditSupport())
4970      {
4971        result.add(genModel.getImportedName(genModel.getQualifiedEditPluginClassName()));
4972      }
4973    }
4974    return result;
4975  }
4976
4977  public boolean reconcile(GenModel oldGenModelVersion)
4978  {
4979    boolean result = false;
4980    if (oldGenModelVersion != null)
4981    {
4982      for (Iterator JavaDoc i = getGenPackages().iterator(); i.hasNext(); )
4983      {
4984        GenPackage genPackage = (GenPackage)i.next();
4985        for (Iterator JavaDoc j = oldGenModelVersion.getGenPackages().iterator(); j.hasNext(); )
4986        {
4987          GenPackage oldGenPackageVersion = (GenPackage)j.next();
4988          if (genPackage.reconcile(oldGenPackageVersion))
4989          {
4990            result = true;
4991            break;
4992          }
4993        }
4994      }
4995
4996      reconcileSettings(oldGenModelVersion);
4997    }
4998
4999    return result;
5000  }
5001
5002  protected void reconcileSettings(GenModel oldGenModelVersion)
5003  {
5004    if (oldGenModelVersion.isSetEditDirectory())
5005    {
5006      setEditDirectory(oldGenModelVersion.getEditDirectory());
5007    }
5008    else
5009    {
5010      unsetEditDirectory();
5011    }
5012    if (oldGenModelVersion.isSetEditPluginClass())
5013    {
5014      setEditPluginClass(oldGenModelVersion.getEditPluginClass());
5015    }
5016    else
5017    {
5018      unsetEditPluginClass();
5019    }
5020    if (oldGenModelVersion.isSetEditorDirectory())
5021    {
5022      setEditorDirectory(oldGenModelVersion.getEditorDirectory());
5023    }
5024    else
5025    {
5026      unsetEditorDirectory();
5027    }
5028    if (oldGenModelVersion.isSetEditorPluginClass())
5029    {
5030      setEditorPluginClass(oldGenModelVersion.getEditorPluginClass());
5031    }
5032    else
5033    {
5034      unsetEditorPluginClass();
5035    }
5036    if (oldGenModelVersion.isSetTestsDirectory())
5037    {
5038      setTestsDirectory(oldGenModelVersion.getTestsDirectory());
5039    }
5040    else
5041    {
5042      unsetTestsDirectory();
5043    }
5044    if (oldGenModelVersion.isSetTestSuiteClass())
5045    {
5046      setTestSuiteClass(oldGenModelVersion.getTestSuiteClass());
5047    }
5048    else
5049    {
5050      unsetTestSuiteClass();
5051    }
5052
5053    setCopyrightText(oldGenModelVersion.getCopyrightText());
5054    setModelDirectory(oldGenModelVersion.getModelDirectory());
5055    setCreationCommands(oldGenModelVersion.isCreationCommands());
5056    setCreationIcons(oldGenModelVersion.isCreationIcons());
5057    setModelPluginID(oldGenModelVersion.getModelPluginID());
5058    setTemplateDirectory(oldGenModelVersion.getTemplateDirectory());
5059    setRuntimeJar(oldGenModelVersion.isRuntimeJar());
5060    setBundleManifest(oldGenModelVersion.isBundleManifest());
5061
5062    // EATM
5063
// Foreign Model
5064

5065    setDynamicTemplates(oldGenModelVersion.isDynamicTemplates());
5066    setRedirection(oldGenModelVersion.getRedirection());
5067    setForceOverwrite(oldGenModelVersion.isForceOverwrite());
5068    setNonExternalizedStringTag(oldGenModelVersion.getNonExternalizedStringTag());
5069
5070    setModelName(oldGenModelVersion.getModelName());
5071
5072    setModelPluginClass(oldGenModelVersion.getModelPluginClass());
5073    setUpdateClasspath(oldGenModelVersion.isUpdateClasspath());
5074    setGenerateSchema(oldGenModelVersion.isGenerateSchema());
5075    setNonNLSMarkers(oldGenModelVersion.isNonNLSMarkers());
5076    getModelPluginVariables().addAll(oldGenModelVersion.getModelPluginVariables());
5077    getStaticPackages().addAll(oldGenModelVersion.getStaticPackages());
5078    setRootExtendsInterface(oldGenModelVersion.getRootExtendsInterface());
5079    setRootImplementsInterface(oldGenModelVersion.getRootImplementsInterface());
5080    setRootExtendsClass(oldGenModelVersion.getRootExtendsClass());
5081    setSuppressEMFTypes(oldGenModelVersion.isSuppressEMFTypes());
5082    setFeatureMapWrapperInterface(oldGenModelVersion.getFeatureMapWrapperInterface());
5083    setFeatureMapWrapperInternalInterface(oldGenModelVersion.getFeatureMapWrapperInternalInterface());
5084    setFeatureMapWrapperClass(oldGenModelVersion.getFeatureMapWrapperClass());
5085
5086    setRuntimeCompatibility(oldGenModelVersion.isRuntimeCompatibility());
5087    setRichClientPlatform(oldGenModelVersion.isRichClientPlatform());
5088    setCodeFormatting(oldGenModelVersion.isCodeFormatting());
5089        
5090    setBooleanFlagsField(oldGenModelVersion.getBooleanFlagsField());
5091    setBooleanFlagsReservedBits(oldGenModelVersion.getBooleanFlagsReservedBits());
5092  }
5093
5094  public boolean reconcile()
5095  {
5096    for (Iterator JavaDoc i = getGenPackages().iterator(); i.hasNext(); )
5097    {
5098      GenPackage genPackage = (GenPackage)i.next();
5099      if (!genPackage.reconcile())
5100      {
5101        i.remove();
5102      }
5103    }
5104    for (Iterator JavaDoc i = getUsedGenPackages().iterator(); i.hasNext(); )
5105    {
5106      GenPackage genPackage = (GenPackage)i.next();
5107      if (!genPackage.reconcile())
5108      {
5109        i.remove();
5110      }
5111    }
5112    getUsedGenPackages().addAll(computeMissingUsedGenPackages());
5113    
5114    return !getGenPackages().isEmpty();
5115  }
5116  
5117  public List JavaDoc computeMissingUsedGenPackages()
5118  {
5119    List JavaDoc missingEPackages = getMissingPackages();
5120    if (!missingEPackages.isEmpty())
5121    {
5122      List JavaDoc allGenModels = new UniqueEList.FastCompare();
5123      allGenModels.add(this);
5124      for (int i = 0; i < allGenModels.size(); i++)
5125      {
5126        GenModel genModel = (GenModel)allGenModels.get(i);
5127        for (int j = 0; j < genModel.getUsedGenPackages().size(); j++)
5128        {
5129          GenPackage genPackage = (GenPackage)genModel.getUsedGenPackages().get(j);
5130          allGenModels.add(genPackage.getGenModel());
5131        }
5132      }
5133
5134      List JavaDoc usedGenPackages = new UniqueEList.FastCompare();
5135      for (int i = 0; i < missingEPackages.size(); i++)
5136      {
5137        EPackage ePackage = (EPackage)missingEPackages.get(i);
5138        for (int j = 0; j < allGenModels.size(); j++)
5139        {
5140          GenModel genModel = (GenModel)allGenModels.get(j);
5141          GenPackage genPackage = genModel.findGenPackage(ePackage);
5142          if (genPackage != null)
5143          {
5144            usedGenPackages.add(genPackage);
5145            getMissingPackagesHelper(missingEPackages, Collections.singletonList(genPackage));
5146            break;
5147          }
5148        }
5149      }
5150      return usedGenPackages;
5151    }
5152    else
5153    {
5154      return Collections.EMPTY_LIST;
5155    }
5156  }
5157
5158  public List JavaDoc getMissingPackages()
5159  {
5160    List JavaDoc ePackages = new UniqueEList();
5161    getMissingPackagesHelper(ePackages, getGenPackages());
5162    getMissingPackagesHelper(ePackages, getUsedGenPackages());
5163    return ePackages;
5164  }
5165
5166  protected void getMissingPackagesHelper(List JavaDoc ePackages, List JavaDoc genPackages)
5167  {
5168    for (Iterator JavaDoc i = genPackages.iterator(); i.hasNext(); )
5169    {
5170      GenPackage genPackage = (GenPackage)i.next();
5171      EPackage ePackage = genPackage.getEcorePackage();
5172      if (ePackage != null)
5173      {
5174        for (Iterator JavaDoc j = ePackage.eAllContents(); j.hasNext();)
5175        {
5176          EObject eObject = (EObject)j.next();
5177          for (Iterator JavaDoc k = eObject.eCrossReferences().iterator(); k.hasNext(); )
5178          {
5179            Object JavaDoc o = k.next();
5180            if (o instanceof EClassifier)
5181            {
5182              EClassifier eClassifier = (EClassifier)o;
5183              if (findGenClassifier(eClassifier) == null)
5184              {
5185                ePackages.add(eClassifier.getEPackage());
5186              }
5187            }
5188          }
5189        }
5190      }
5191    }
5192  }
5193
5194
5195  public boolean hasXMLDependency()
5196  {
5197    for (Iterator JavaDoc i = getAllGenPackagesWithClassifiers().iterator(); i.hasNext(); )
5198    {
5199      GenPackage genPackage = (GenPackage)i.next();
5200      switch (genPackage.getResource().getValue())
5201      {
5202        case GenResourceKind.XML:
5203        case GenResourceKind.XMI:
5204        {
5205          return true;
5206        }
5207      }
5208    }
5209    return false;
5210  }
5211
5212  public String JavaDoc getXMLEncodingChoices()
5213  {
5214    return CodeGenEcorePlugin.INSTANCE.getString("_UI_XMLEncodingChoices");
5215  }
5216
5217  public String JavaDoc getIndentation(StringBuffer JavaDoc stringBuffer)
5218  {
5219    int index = stringBuffer.length();
5220    LOOP:
5221    while (--index >= 0)
5222    {
5223      switch (stringBuffer.charAt(index))
5224      {
5225        case '\n':
5226        case '\r':
5227        {
5228          break LOOP;
5229        }
5230      }
5231    }
5232    return stringBuffer.substring(index + 1);
5233  }
5234
5235  public EModelElement getEcoreModelElement()
5236  {
5237    return ((GenPackage)getGenPackages().get(0)).getEcorePackage();
5238  }
5239
5240  public List JavaDoc/*GenFeature*/ getAllGenFeatures()
5241  {
5242    List JavaDoc result = new ArrayList JavaDoc();
5243
5244    // Any features from one package that delegate to features in another.
5245
//
5246
List JavaDoc delegated = new ArrayList JavaDoc();
5247
5248    for (Iterator JavaDoc iter = getAllGenAndUsedGenPackagesWithClassifiers().iterator(); iter.hasNext(); )
5249    {
5250      GenPackage genPackage = (GenPackage)iter.next();
5251      if (genPackage.getGenModel() == this || !genPackage.getGenModel().hasEditSupport())
5252      {
5253        for (Iterator JavaDoc fIter = genPackage.getAllGenFeatures().iterator(); fIter.hasNext(); )
5254        {
5255          GenFeature genFeature = (GenFeature)fIter.next();
5256          List JavaDoc addTo = genFeature.getGenPackage() == genPackage ? result : delegated;
5257          addTo.add(genFeature);
5258        }
5259      }
5260    }
5261
5262    // If there are features delegating across packages, add only those that aren't already being generated.
5263
//
5264
if (!delegated.isEmpty())
5265    {
5266      addNonDuplicates(result, delegated, null);
5267    }
5268    return result;
5269  }
5270
5271  public List JavaDoc/*GenFeature*/ getFilteredAllGenFeatures()
5272  {
5273    ArrayList JavaDoc result = new ArrayList JavaDoc();
5274
5275    // We need to filer out duplicates in the unlikely event that we have two
5276
// features with the same class-qualifed name. We'll only generate one property
5277
// string in that case and let the user add the second one mannually, if necessary.
5278
//
5279
Set JavaDoc noDupSet = new HashSet JavaDoc();
5280    for (Iterator JavaDoc iter = getAllGenFeatures().iterator(); iter.hasNext(); )
5281    {
5282      GenFeature genFeature = (GenFeature)iter.next();
5283      if (isCreationCommands() || genFeature.isProperty())
5284      {
5285        if (noDupSet.add(genFeature.getGenClass().getName() + "_" + genFeature.getName()))
5286        {
5287          result.add(genFeature);
5288        }
5289      }
5290    }
5291    return result;
5292  }
5293
5294  protected Map JavaDoc codeFormatterOptions = null;
5295
5296  public void setCodeFormatterOptions(Map JavaDoc options)
5297  {
5298    codeFormatterOptions = options;
5299  }
5300
5301  public CodeFormatter createCodeFormatter()
5302  {
5303    return ToolFactory.createCodeFormatter(codeFormatterOptions);
5304  }
5305  
5306  public boolean isBooleanFlagsEnabled()
5307  {
5308    return !isBlank(getBooleanFlagsField()) && !isReflectiveDelegation();
5309  }
5310
5311  public GenModel createGenModel()
5312  {
5313    return GenModelFactory.eINSTANCE.createGenModel();
5314  }
5315
5316  public GenPackage createGenPackage()
5317  {
5318    return GenModelFactory.eINSTANCE.createGenPackage();
5319  }
5320
5321  public GenClass createGenClass()
5322  {
5323    return GenModelFactory.eINSTANCE.createGenClass();
5324  }
5325
5326  public GenFeature createGenFeature()
5327  {
5328    return GenModelFactory.eINSTANCE.createGenFeature();
5329  }
5330
5331  public GenEnum createGenEnum()
5332  {
5333    return GenModelFactory.eINSTANCE.createGenEnum();
5334  }
5335
5336  public GenEnumLiteral createGenEnumLiteral()
5337  {
5338    return GenModelFactory.eINSTANCE.createGenEnumLiteral();
5339  }
5340
5341  public GenDataType createGenDataType()
5342  {
5343    return GenModelFactory.eINSTANCE.createGenDataType();
5344  }
5345
5346  public GenOperation createGenOperation()
5347  {
5348    return GenModelFactory.eINSTANCE.createGenOperation();
5349  }
5350
5351  public GenParameter createGenParameter()
5352  {
5353    return GenModelFactory.eINSTANCE.createGenParameter();
5354  }
5355  
5356  public Set JavaDoc getPropertyCategories()
5357  {
5358    Set JavaDoc categories = new HashSet JavaDoc();
5359    for (Iterator JavaDoc i = getFilteredAllGenFeatures().iterator(); i.hasNext();)
5360    {
5361      String JavaDoc category = ((GenFeature)i.next()).getPropertyCategory();
5362
5363      if (!isBlank(category))
5364      {
5365        categories.add(category);
5366      }
5367    }
5368    return categories;
5369  }
5370  
5371  public boolean hasLocalGenModel()
5372  {
5373    if (eResource() != null && eResource().getURI() != null)
5374    {
5375      URI genModelURI = eResource().getURI();
5376      URI modelDirectory = URI.createURI(getModelDirectory());
5377      return
5378        "platform".equals(genModelURI.scheme()) &&
5379           genModelURI.segmentCount() > 1 &&
5380           "resource".equals(genModelURI.segment(0)) &&
5381           modelDirectory.segmentCount() > 0 &&
5382           genModelURI.segment(1).equals(modelDirectory.segment(0));
5383    }
5384    else
5385    {
5386      return false;
5387    }
5388  }
5389  
5390  public String JavaDoc getRelativeGenModelLocation()
5391  {
5392    URI genModelURI = eResource().getURI();
5393    String JavaDoc result = genModelURI.deresolve(genModelURI.trimSegments(genModelURI.segmentCount() - 3)).toString();
5394    return result;
5395  }
5396  
5397  public String JavaDoc getPropertyCategoryKey(String JavaDoc category)
5398  {
5399    return "_UI_" + CodeGenUtil.validJavaIdentifier(category) + "PropertyCategory";
5400  }
5401
5402} //GenModelImpl
5403
Popular Tags